What does errno 106 (EISCONN) mean?

 
Could be also:
ConstantTypeOS
ERROR_SEM_USER_LIMITWin32 errorWindows
EQFULLerrnoMac
ELASTerrnoMac
ECONNABORTEDerrnoWindows
LPC_INITIALIZATION_FAILEDBugCheck CodeWindows
Previous Next
ECANCELED EQFULL

EISCONN

EISCONN is a state-machine error: the socket already has a peer, but the caller is trying to establish another connection or provide a destination where the API expects the existing peer to be used. It is most often caused by a duplicate connect(), reusing a connection object after the handshake, or passing a target address to a connection-mode send call.

For a stream socket, connection setup should happen exactly once for each socket lifetime. After successful completion of a nonblocking connect, transition the object out of the “connecting” state and send data without another destination. Linux documents that sendto() on a connected connection-mode socket ignores the destination arguments on some paths and may return EISCONN on others; portable code should not rely on either behavior.

What to check

  • Ensure only one component owns the connection state transition.
  • After a writable connect event, read SO_ERROR once and update the state atomically.
  • Use a separate socket for a different remote endpoint instead of re-calling connect() on the established stream.

POSIX connect() · Linux send(2) · UNIX-domain socket errors


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