| Previous | Next |
| WSAEMSGSIZE | WSAENOPROTOOPT |
WSAEPROTOTYPE
WSAEPROTOTYPE is a socket-construction mismatch. The requested protocol does not implement the communication semantics implied by the selected socket type. A familiar example is choosing UDP while requesting a stream socket: UDP is datagram-oriented, while SOCK_STREAM requests a reliable byte stream.
How to read the three creation parameters
A socket is selected by address family, type, and protocol. The family chooses an addressing namespace such as IPv4 or IPv6; the type chooses stream, datagram, raw, or another communication model; the protocol must be compatible with both. The code therefore points to the call that creates the socket or selects a provider, not to a server-side failure after a connection begins.
Useful checks
- Log the exact
af,type, andprotocolpassed tosocketorWSASocket. - Use a protocol of zero when the selected family and type have an unambiguous default, unless a specific transport is required.
- Keep raw or provider-specific socket setup separate from ordinary TCP/UDP setup.
Microsoft: WSASocket · Microsoft: Winsock error codes · The Open Group: socket
Looking for a different code? Search another status or error code.