In our application we have a standard TCP/IP Server socket programming to allow clients to connect to the Server.
What i have noticed is after certain number of connections the client is not able to open up new connection to the server. The number by which i encountered the issues is 946 client connection. After which I got connection refused error on the client side.
The server is running in Linux box (64 bit). The server is still up an running, no out-of-memory error.
I don't see an issue with backlog, since I am having only one client which is looping through and opening up the new connection and put it in the array.
I am performing the stress testing on maximum number of connections the client could open to the server and how to maximize the same.
Any thoughts?
Edit 1: Server is not listening on the the port which I am trying to connect. On the server I got below error.
'08:10:41:055 [*] [TcpServer] - java.net.SocketException: Too many open files <stack trace follows>
08:10:41:055 [*] [TcpServer] - at java.net.PlainSocketImpl.socketAccept(Native Method)
08:10:41:055 [*] [TcpServer] - at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
08:10:41:055 [*] [TcpServer] - at java.net.ServerSocket.implAccept(ServerSocket.java:522)
08:10:41:055 [*] [TcpServer] - at sun.security.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:317)
I increased the file limit as mentioned here. This solved the issue.