| Previous | Next |
| EOWNERDEAD | EPROTO |
ENOTCONN
A state precondition for the operation was not met
ENOTCONN is returned when the requested data operation requires connection state that the transport endpoint does not have. Solaris also notes the datagram case: sending without an established peer and without supplying a destination leaves the transport with nowhere to send the message.
The code should not be diagnosed as “the remote host is offline” without first examining local socket state. ECONNREFUSED describes an active rejection during connection establishment; ENOTCONN can arise before a valid connection attempt has established any peer at all.
State checks for ENOTCONN
- Record the failing operation and whether the socket is connection-mode or connectionless-mode.
- Verify the result of the preceding
connect(); for nonblocking connect, completion must be established before using connection-dependent operations. - For an unconnected datagram socket, ensure the send operation supplies the destination address expected by the API.
References
- Oracle Solaris intro(2) errno catalog
- POSIX connect() error conditions
- POSIX sendto() destination and connection semantics
Looking for a different code? Search another status or error code.
