What does errno 48 (EADDRINUSE) mean?

 
Could be also:
ConstantTypeOS
KERN_NOT_WAITINGKern returnMac
ippStsSizeWrnIntel Ipp StatusAny
ELNRNGerrnoLinux
ENOTSUPerrnoSolaris
SET_OF_INVALID_CONTEXTBugCheck CodeWindows
Previous Next
ELNRNG ENOTSUP

EADDRINUSE

Local address ownership conflicts

EADDRINUSE means that the local address requested by the operation is already in use. It can arise from an explicit bind(), but connection setup can also need a local ephemeral address and discover that an acceptable local tuple is unavailable.

The error says nothing about whether a remote service is running. It is a local namespace conflict involving address family, local address, port, protocol, and sometimes connection state. A single “port in use” message is too coarse to explain the conflict.

Evidence to collect before changing options

  • Record the exact requested local address, port, family, socket type, protocol, and whether the process called bind() explicitly.
  • Inspect listeners and recently closed connections that match the relevant tuple; do not assume another process owns the same port on every local address.
  • Document any address-reuse socket options and their ordering before bind(). Their semantics are platform- and protocol-dependent, so they are not a universal fix.

Contrast with EADDRNOTAVAIL

EADDRINUSE means the address is already occupied. EADDRNOTAVAIL means the requested local address is not currently available on this machine. One is a conflict; the other is an invalid or absent local address.

References


Looking for a different code? Search another status or error code.