| Previous | Next |
| EMLINK | EDOM |
EPIPE
EPIPE occurs when code tries to write to a connection-oriented socket whose sending path is no longer usable. The peer may have closed the connection, the local code may already have called shutdown(..., SHUT_WR), or the transport may have detected that the session is broken. The failing write must not be treated as delivered.
On Linux, a send that returns EPIPE can also generate SIGPIPE. Unless the process deliberately handles or suppresses that signal, its default action can terminate the process before ordinary error handling runs. Linux offers MSG_NOSIGNAL as a per-send option; applications can also manage SIGPIPE at the process or thread policy level, but a global change has wider effects.
Recommended handling
- Stop using the socket, discard it from a connection pool, and establish a new connection for a safe retry.
- Track application acknowledgements; the request might have reached the peer before the break was observed.
- Record whether the failure followed local shutdown, peer close, a reset, or a write after a long idle period.
Linux send(2) and MSG_NOSIGNAL · POSIX sendmsg() · Linux socket(2)
Looking for a different code? Search another status or error code.