How to determine with java what is the limit on the number of open tcp sockets (files).

Knocks out the exception java.net.SocketException: Too many open files , the reason: connections exceeded 4096, not the server version of the OS.

OS: Linux, Windows and so on.

  • Off topic: You do something wrong if you need it. By topic: I know for sure that in Linux this number is in a file, in which I don’t remember, I remember for sure that it is googling. By "too many open files linux" - Stranger in the Q
  • Yes, this is for linux, and for windows (and so on), since Java is able to determine how to determine if in the end there are no answers, you will have to make a fix limit. - Denis Kotlyarov
  • Java doesn’t determine, she gets an exception from the OS - Stranger in the Q
  • At that moment when an attempt to open a new descriptor fails - Stranger in the Q
  • I also thought about this, but even so I could find the number of max connections, I need at least 1 additional free connection, just to accept it, send that server is blocked and close this connection. - Denis Kotlyarov

0