Hi everyone,
I have programmed a PHP server that handles socket connections.
The system works perfectly, but sometimes a strange thing happens.
Users who have wireless connections remain freezed when their connection slows down or ends badly.
At first I thought it was a problem due to the fact that the server did not notice that the connection was dropped because the client did not send the RST signal.
Then I inserted a verification system on the server that sends a message to the client if there were no IO operations within a fixed interval.
If the client does not respond to this message then the server assumes that:
(1) the connection is dropped without sending the reset signal or (2) the connection is not dropped but is very slow.
Both in the case (1) that in the case (2) the socket is forced to be closed by the server.
For some clients the problem has been solved, but unfortunately there are still other clients that are blocked.
My question is: if the connection with the client did not fall but it's just slowed down (which is often the case with wireless), what happens if suddenly the connection is resumed?
The scenario should be this:
- The client slows
- Server sends the control message
- The client does not receive it in time
- The server closes the connection brutally
- The client resumes the connection but did not receive the reset signal
is it possible?
how can I solve?