Java Socket Server and a C++ socket client
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   rajesh_kumar
Posted On:   Friday, May 28, 2004 10:05 PM

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(Connection 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(7999,60); } catch (IOE   More>>

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(Connection 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(7999,60);
}
catch (IOException e)
{
System.out.println(e);
}

try
{
while (true)
{
clientSocket = Server.accept();
SocketThread objThread = new SocketThread(clientSocket);
objThread.start();
}
}
catch (Exception e)
{
System.out.println(e);
}
finally
{

try
{
Server.close();
}
catch (IOException e)
{
System.out.println(e);
}
}

}
}
   <<Less
About | Sitemap | Contact