• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to create 3000 Server Socket objects on Windows  RSS feed

 
krishna teja
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am developing an application, where the requirement of the application is to create 3000 server socket objects and listen to the incoming data. When I try to create 3000 socket server objects in the program, I am encountering an IOException stating that the BUFFER LIMIT is attained.

The program which is generating the 3000 Server Socket objects is being developed on Windows.

Q 1) Is this a limitation which Windows imposes?

Q 2) If this is not an Operating System issue then how do I get around with this problem.

Relevant answers are appreciated.

thank you
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is kind of an unusual design. Normally you'd have a single ServerSocket, and then put a multi-threaded server behind it so that it can process multiple incoming requests. Can you tell us why so many server sockets are required? (What's more, since every ServerSocket runs on its own port, the clients need to know which port to connect to.)
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's an OS limitation. As Ulf says, this is not the way things are normally done. What are you trying to achieve with this design?
 
krishna teja
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The requirement of the application is to simulate n number of servers. In this case the application needs to assign a unique port to each SocketServer and listen on that port. But I am unable to create beyond 325 server sockets.

So, is this a limitation which OS imposes or can i increase the buffer size.

Please understand the situation. The application needs to simulate n number of servers and server the requests.


Thank you
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I already said, it's an OS limitation, unrelated to Java. You'd want to refer to Windows administation documents to learn how to raise this limit, if it's possible.

But if you're doing a simulation, then why use real ServerSockets? Do a simulation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!