Hi,
We have a socket server app in Java and the client application in C++.
When we try to connect 60 clients simultaneously from C++ using
threads, only 55-56 connections are successfull, rest are not
connected(Conne ction refused error).
For one connection everything works fine. In server side each
connection is handled in seperate thread.
Is there anything else to be done?
The server code is as follows.
public class SocketServer
{
public static void main(String args[])
{
ServerSocket Server = null;
Socket clientSocket = null;
try
{
Server = new ServerSocket(79 99,60);
}
catch (IOException e)
{
System.out.prin tln(e);
}
try
{
while (true)
{
clientSocket = Server.accept() ;
SocketThread objThread = new SocketThread(cl ientSocket);
objThread.start ();
}
}
catch (Exception e)
{
System.out.prin tln(e);
}
finally
{
try
{
Server.close();
}
catch (IOException e)
{
System.out.prin tln(e);
}
}
}
}
We have a socket server app in Java and the client application in C++.
When we try to connect 60 clients simultaneously from C++ using
threads, only 55-56 connections are successfull, rest are not
connected(Conne ction refused error).
For one connection everything works fine. In server side each
connection is handled in seperate thread.
Is there anything else to be done?
The server code is as follows.
public class SocketServer
{
public static void main(String args[])
{
ServerSocket Server = null;
Socket clientSocket = null;
try
{
Server = new ServerSocket(79 99,60);
}
catch (IOException e)
{
System.out.prin tln(e);
}
try
{
while (true)
{
clientSocket = Server.accept() ;
SocketThread objThread = new SocketThread(cl ientSocket);
objThread.start ();
}
}
catch (Exception e)
{
System.out.prin tln(e);
}
finally
{
try
{
Server.close();
}
catch (IOException e)
{
System.out.prin tln(e);
}
}
}
}
Comment