| 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
sendorrecvis called before a stream connection has completed.- A connectionless socket has no default peer, while the code uses
sendinstead ofsendto. - A connected UDP socket was disconnected by calling
connectwith 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.
Looking for a different code? Search another status or error code.