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].
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