Results 1 to 1 of 1
Thread: help me out with senddatatoall()
- 07-05-2010, 10:41 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 28
- Rep Power
- 0
help me out with senddatatoall()
hey friends m not able to debug a problem in the following method if any one could help me out that would be a great favour
i have a socket server which has to deliver the data to all the connected clients and the server is unable to handle the situation where one of the clients daces illegal network congestion say NIC is being disabled
the method is as follows
void SendDataToAll(String MSG) throws IOException
{
String[] objData = split(MSG, ',');
for (int i = 0; i<ClientsConnected.size() ; i++)
{
try
{
os = ((Client) ClientsConnected.get(i)).SocketObject.getOutputStr eam();
if(objData.length == 3 && ClientsConnected.size() >0)
{
if(ObjServerThread.objSymbol.contains((Object)objD ata[0]))
{
try
{
senddata(MSG);
}
catch(Exception e)
{
ConnectedID.remove(((Client) ClientsConnected.get(i)).ClientIDObject);
ClientsConnected.remove(((Client) ClientsConnected.get(i)));
break;
}
os = null;
}
}
}
catch(Exception e)
{
//ClientsConnected.remove(i);
//ConnectedID.remove(i);
}
finally
{
os = null;
//break;
}
}
}
consider the message string to be MSG = Shyam,Maths,100


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks