JBY Technologies

Connection Reset By Peer

Here is some boring stuff that I collected. Thought I would share. Sorry, it is more of an explanation than a solution...

Linux errno.h:

#define ECONNRESET 104 /* Connection reset by peer */


Forum post:

The remote server has sent you a RST packet, which indicates an immediate dropping of the connection, rather than the usual handshake. This bypasses the normal half-closed state transition. I like this description:

"Connection reset by peer" is the TCP/IP equivalent of slamming the phone back on the hook. It's more polite than merely not replying, leaving one hanging. But it's not the FIN-ACK expected of the truly polite TCP/IP converseur.


Java developer forum post:

Connection Reset by Peer is a tcp/ip error which is sent when the remote peer (e.g. client) lost information about the tcp/ip connection to the server (e.g. machine went down, etc)

The most common time you would get this would be if the user exited out of the browser (or off the web) before the servlet was complete (you may also get it if the user hit re-load or went to another web page, however those are generally Socket Closed exceptions)

In this case, when the system is busy, users are probably giving up (reloading, stopping the current transfer, loading a new page, shutting down the browser or breaking the network connection) which explains the error messages



A connection was forcibly closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or a restart. On a datastream socket, the connection was reset. This reset could be generated locally by the network system when it detects a connection failure, or it might be received from the remote host (in TCP terms, the remote host sent an RST packet). This error is also possible on a datagram socket; for instance, this error could result if your application sends a UDP datagram to a host, which rejects it by responding with an ICMP Port Unreachable.


The problem in troubleshooting this error is that it may not actually come from the peer. Let's say that a user is connected from their computer to a switch at their office, then from that switch to a router at their office, then from that router over the internet to a router at the office where the server is, then from that router to a switch where the server is, then from that switch to the server... any of those devices along the way could be sending the RST packet.

Fyi, FIN, (finished) ACK (acknowledgement) and RST (reset) are types of tcp/ip signals.

Bookmark and Share

Legal Notices