| Previous | Next |
| ESHUTDOWN | ETOOMANYREFS |
ECONNRESET
ECONNRESET means an established or partially established connection was reset instead of closing cleanly. It does not identify why the reset occurred. A peer application, a load balancer, a firewall, a proxy, a transport implementation, or a protocol violation can all produce an abrupt reset at different layers.
On Windows socket APIs, obtain WSAECONNRESET through WSAGetLastError(); do not expect Winsock to write this UCRT errno macro. For stream sockets, a reset is distinct from recv returning zero after a graceful peer shutdown.
Evidence for a reset investigation
- Record whether the error occurred on connect, send, receive, or asynchronous completion, together with connection age and byte counts in both directions.
- Preserve protocol phase and last complete message. A reset during a handshake points to a different class of causes than a reset after idle time.
- Correlate with server, proxy, and firewall logs using timestamps and connection identifiers where available.
- Treat the socket as failed. A retry requires a new connection and an application-level decision about whether the interrupted request is safe to repeat.
References
Looking for a different code? Search another status or error code.