> Hi
> I am writing an Application in which i need to create
> 2000 server sockets. When I am trying to create, I am
> encountering an IO Exception Saying no buffer...
>
> So is that an issue with Operating System?
Sounds like it.
>
> Can any help me to find the solution
>
Remove the requirement for 2000 simultaneous server sockets. 2000 seems excessive.
> The reply sound great but unfortunately the
> requirement is not subjected to change.
>
> If this is a limitation of the Operating System then
> my question is how to over come this problem?
Well, it depends on what OS you are using. It's possible to configure in some operating systems (and it's not a Java question in that case, so please don't ask)
Kaj
Since the application is being developed in JAVA and
ServerSocket socketServer = new ServerSocket(iPort);
is throwing IO Exception and is not allowing me to create more instances of ServerSocket objects. This is the reason behind posting this issue in java forums.
I thought this is something which people might have faced and since this is developed in java this issue is posted.
I guess no one should have a problem when it comes to sharing knowledge.
thank you
Here is the exception that is being thrown
java.net.SocketException: No buffer space available (maximum connections reached?): listen failed
at java.net.PlainSocketImpl.socketListen(Native Method)
at java.net.PlainSocketImpl.listen(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
The above exception is being thrown after 325 serversocket objects are created.
The Question now is is this some thing which is Windows dependent?
OR
Is there any issue which can be fixed programatically?
thank you
> Since the application is being developed in JAVA
>
Doesn't matter if you are using Java, VB or C++. You would have the same problem, and that is why it isn't Java related. It's OS related, and you should post the question in a forum that is related to configuration / administration of your OS type.
Kaj
Are you sure you really need 2000 server sockets? If you want to host 2000 connections to remote clients, you should only need 1 server socket to host them all.
But that usually means 1 thread to process data on each client connection, and 2000 threads aren't going to perform very well. For this number of connections, you might want to look into the java.nio package and use that instead of regular sockets.