Max open socket connections
Server socke开发者_JAVA百科t application falls with SocketException - connection Refused
Is exist limitations on max accepted or open sockets per one application ?
You're not really giving us enough information to go on.
The number of sockets that can be open concurrently on a single Windows machine is limited by machine wide resources. There are no 'per process' limits that affect the number of sockets that can be open (except, perhaps, some per process non paged pool quotas that might be applied, but I've never come across this in the wild).
I've written about the per-machine limits here on my blog: http://www.serverframework.com/asynchronousevents/2010/12/one-million-tcp-connections.html
There are many reasons that you might get a connection refused error and if you could give us some more information we might be able to narrow down the cause of your problem.
If ALL connections to your server fail with "connection refused" then..
- Your server might not be running.
- You might not be listening on the right port.
- A firewall might be getting in the way
If you manage to connect once but then fail to connect then...
- Your connection acceptance logic might be broken.
If you get "connection refused" when there are lots of concurrent connection attempts happening, some connections work, some fail, then...
- Your listen backlog might be too small
- You may be taking too long to process new connections
精彩评论