| Previous | Next |
| ETOOMANYREFS | ETIMEDOUT |
EDESTADDRREQ
EDESTADDRREQ indicates that a message-oriented operation needs a destination endpoint, but the caller has not provided one and the socket has no default peer. It is primarily a state-and-API contract issue, not a network reachability problem.
For Winsock, the native counterpart is WSAEDESTADDRREQ. A datagram socket can receive a destination from each sendto-style call or obtain a default peer through connect; those choices produce different application semantics, especially when the client communicates with multiple peers.
Make the addressing model explicit
- For an unconnected datagram socket, pass a fully initialized destination address and its correct structure length on every send.
- For a connected datagram socket, verify when the default peer was assigned and whether a reconnect or close reset that state.
- Log the actual destination family, address, port, and scope information. A null or zeroed address is not equivalent to an automatic route choice.
- Do not confuse this error with a remote refusal: the operation failed before a usable destination was selected.
References
Looking for a different code? Search another status or error code.
