What does errno 36 (EINPROGRESS) mean?

 
Could be also:
ConstantTypeOS
ERROR_SHARING_BUFFER_EXCEEDEDWin32 errorWindows
KERN_NOT_DEPRESSEDKern returnMac
ippStsNotSupportedCpuIntel Ipp StatusAny
ENAMETOOLONGerrnoLinux
EIDRMerrnoSolaris
EDEADLKerrnoWindows
NTFS_FILE_SYSTEMBugCheck CodeWindows
Previous Next
EAGAIN EALREADY

EINPROGRESS

A pending operation, not a completed connection

EINPROGRESS is the expected intermediate result when a nonblocking socket operation cannot finish immediately. For a connection attempt, it says that the kernel accepted the request and the socket is still progressing through connection setup; it does not say that the peer accepted the connection.

Treat this result as a state transition. Repeating connect() in a tight loop can replace useful evidence with EALREADY or hide the final result. Wait for the readiness mechanism used by the application, then read the socket's pending error with getsockopt(..., SO_ERROR, ...) before declaring success.

What to retain for diagnosis

  • Capture the address family, socket type, protocol, nonblocking flag, local and remote addresses, and the instant at which the attempt was started.
  • Record the readiness event and the later SO_ERROR value. Writability alone is not proof that a nonblocking connection succeeded.
  • Keep the connection deadline separate from the kernel's state: an application timeout may cancel a still-pending attempt without proving that the network rejected it.

Do not confuse it with

EALREADY means another operation is already pending on the same object; EISCONN means the socket already has a connected peer. EINPROGRESS is the only one of the three that normally describes the first observable pending state.

References


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