What does errno 58 (ESHUTDOWN) mean?

 
Could be also:
ConstantTypeOS
ERROR_BAD_NET_RESPWin32 errorWindows
EDEADLOCKerrnoLinux
EOWNERDEADerrnoSolaris
SYSTEM_UNWIND_PREVIOUS_USERBugCheck CodeWindows
Previous Next
ENOTCONN ETIMEDOUT

ESHUTDOWN

The application closed this direction of the connection

ESHUTDOWN means that a send operation was attempted after the socket had already been shut down for sending. shutdown() changes the permitted receive and send directions without closing the file descriptor itself, so a live descriptor does not imply that both directions remain usable.

This is a local lifecycle error. It should be distinguished from a remote graceful close, which affects receive behavior, and from a reset, which discards connection state rather than intentionally disabling a selected direction.

How to make the transition observable

  • Record the shutdown() call, its how value, the connection identifier, and any queued writes that existed at that moment.
  • Make writers observe the same state transition before they enqueue data. Otherwise a later worker can report ESHUTDOWN long after the source of the close is no longer visible.
  • Keep close() and shutdown() semantically separate in logs: the POSIX file descriptor remains open after a successful shutdown.

Recovery depends on protocol semantics

Opening a new connection may be appropriate, but it does not make the old socket writable again. First decide whether queued data was intentionally abandoned, fully transmitted, or requires an application-level replay rule.

References


Looking for a different code? Search another status or error code.