| Previous | Next |
| ELOOP | ENOMSG |
EPROTOTYPE
EPROTOTYPE signals a mismatch between protocol expectations and socket type. The exact trigger varies by API and address family: code may request an incompatible protocol for a socket type, or it may try to communicate with an endpoint whose type does not match the local socket. For example, UNIX-domain sockets can report it when a datagram socket targets a stream socket or the reverse.
This is usually a programming or configuration error, not a transient network problem. Retrying the identical call will not make a stream endpoint become a datagram endpoint. The useful evidence is the full socket tuple: domain (AF_*), type (SOCK_*), protocol number, and API operation. Keep those values together when using results from getaddrinfo() or a service-discovery configuration.
How to fix it
- Create the socket with the type and protocol required by the peer service.
- For UNIX-domain endpoints, verify both sides use the same stream, datagram, or sequenced-packet model.
- Do not replace a real protocol mismatch with a generic retry loop; fail configuration validation early and report the incompatible values.
POSIX socket() · Linux UNIX-domain sockets · Linux socket(2)
Looking for a different code? Search another status or error code.
