My java code use several threads, each thread run a ServerSocket and goes in accept. These threads communicate each other using java socket. With 121 threads all work at well, but if I run same code with 256 thread I have this error:
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)
I use windows xp sp3, there are several post like this (here ), but nobody post a soution for this problem . I have also installed a windows patch for remove the limit on TCP connection but I not solved my problem.