Hello guys . I am having a really strange problem with my ServerSockets.
first, this is my code of starting a serverSocket:
ServerSocket serverSocket = new ServerSocket(P.PORT);
while (true)
{
...
Socket connectionSocket= serverSocket .accept();
//launch thread to listen to data on this connectionSocket and go to accept new connections
}
basically that’s it . It works quite fine , for a long while . It accepts the connections sends and receives a few data, then closes the connection .
But something happens that it just does not accept connections anymore . In the client, I don’t get any errors, the thread just hangs waiting for the connection (if a timeout is not set). I dont get a “Server not found”, it seems that it can see the server, but the connection is never stabilished.
Sometimes my serverSocket lasts for a week, sometimes a few days . That’s with 200 connections/day .
Anybody has an idea ?
Thanks in advance .