-
Java Server Socket & C++ Client Socket
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);
}
}
}
}
-
The number of sockets that can be opened is limited by the operating system where your server runs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks