What does Windows error code 10057 (WSAENOTCONN) mean?

 
Previous Next
WSAEISCONN WSAESHUTDOWN

WSAENOTCONN

WSAENOTCONN means that an operation requiring a connected socket was attempted when no connection exists. It is often a socket state-management error rather than a network failure.

Common causes

  • send or recv is called before a stream connection has completed.
  • A connectionless socket has no default peer, while the code uses send instead of sendto.
  • A connected UDP socket was disconnected by calling connect with an unspecified address.
  • Another part of the program closed or replaced the connection.

What to do

Make socket state explicit: created, bound, connecting, connected, shutting down, and closed. For datagrams, choose deliberately between a connected UDP socket and per-message destination addresses.

Microsoft: connect · Microsoft: recv


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