What does Windows error code 10101 (WSAEDISCON) mean?

 
Previous Next
WSANOTINITIALISED WSAENOMORE

WSAEDISCON

WSAEDISCON is not the same as an abortive reset. It is returned by WSARecv or WSARecvFrom to indicate that the remote party has initiated a graceful shutdown sequence. On message-oriented sockets, where a zero-length message can be valid data, this error provides an unambiguous end-of-session indication.

How to interpret it

An orderly shutdown tells the application that the peer has finished its send side according to the protocol. It does not prove that every higher-level request was completed successfully. The correct next step depends on the application protocol: consume any already-delivered protocol data, finish its own response if allowed, and close or transition the socket according to the documented teardown sequence.

Useful diagnostics

  • Log the socket type, last complete protocol message, and whether the peer shutdown was expected.
  • Distinguish it from WSAECONNRESET, which indicates an abortive close.
  • Do not continue waiting for ordinary inbound application data after the end-of-session condition has been observed.

Microsoft: WSARecv · Microsoft: connection setup and teardown · The Open Group: shutdown semantics


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