| Previous | Next |
| EPFNOSUPPORT | EAFNOSUPPORT |
ENOPROTOOPT
ENOPROTOOPT means the caller requested a protocol option that the selected socket does not provide. The option name can be valid in another family, socket type, or transport, so the failure is not necessarily a spelling or value error.
On Windows, native Winsock APIs return WSAENOPROTOOPT through WSAGetLastError(). A common source is applying a TCP-only control to a datagram socket or using a family-specific IOCTL where the current provider does not expose it. Keep the option level, name, socket family, type, and protocol in the log.
Validate the option contract
- Record the option level and name separately; a valid option at the wrong level is a different mistake from an unsupported option.
- Record socket family, type, protocol, and provider before the call, not only the final descriptor value.
- Check whether the intended feature belongs to
setsockopt,ioctlsocket, orWSAIoctl. - Do not silently ignore an unsupported security or keepalive option; document the fallback semantics explicitly.
References
Looking for a different code? Search another status or error code.