I am working on a client-server application which communicates over the TCP/IP protocol, where I sporadically get the error connection reset by peer
.
By "connection reset " I mean that the connection has been reset? Or does this mean that the client system has been disconnected from the server and communication between the two is not possible?
It means that the other side * of the connection terminated it.
If the server received this error, it means that the client terminated the connection. If it is the client that received it, it means that the server terminated it.
*I say "the other side of the connection", but it's important to remember that this is only from the point of view of the side that received the error. It's possible that a firewall, router, or other machine between the two endpoints actually terminated the connection. And sometimes, it is possible that both endpoints may receive the same error.
It means that the server has sent you a flag
RST
(Reset) to terminate the connection, that is, the server is aborting the connection because it has been rejected, perhaps because the connection is partially formed.It is similar to the
FIN
(Finish) flag, but it is sent as completion on a successful connection.