I have a service doing listen that serves clients over a TCP sockets connection with a raw binary protocol.
The principle is basic: the connection is established, the client sends a request with data, the service responds with data and the connection is closed.
Everything works fine, however there are random cases where the client stops receiving the response from the service. I noticed that these cases happen when the server starts to have a load. I made a capture of the communication between the client and the service and noticed that in the load tests, in the 6 requests that failed, the 6 have packets with flag [RST].
IP x.95.1
is the client and IP x.95.8
is the service.
The image shows an example of the communication that failed, but I am not understanding correctly the handshake sequence and the reason for [RST], can someone explain to me what may be happening in this sequence?
I need to know which side (PHP client / C++ service)has the socket problem of closing the connection when it appears that the client has done the handshake correctly and then sent the request data, and the reason that they exist these RST packages.
I appreciate some tips. Thanks
[FIN, ACK]
to initiate a close of the connection, to which the client responds at No.5659[ACK]
. However, the same client then sends at No.5687[PSH, ACK]
with the data. This does not seem correct, since the closing process had started, so the service responds[RST]
. Is my reading of the sequence right?