What does Windows error code 10004 (WSAEINTR) mean?

 
Previous Next
DNS_ERROR_POLICY_INVALID_CRITERIA_TIME_OF_DAY WSAEBADF

WSAEINTR

WSAEINTR is a cancellation result for a blocking Winsock 1.1 call. Windows documents this code specifically for a call interrupted through WSACancelBlockingCall; it is not the normal completion result for modern nonblocking or overlapped I/O.

Why the call was interrupted

Older Winsock code could block inside operations such as connect, accept, or recv. A cancellation request ends that wait, so the original operation has no successful result to consume. The error says more about the caller's lifecycle than about the remote host, DNS, routing, or TLS.

How to handle it safely

  • Record the API call, socket state, and the code path that issued cancellation; do not classify it as a network outage.
  • Do not assume that a retry is always correct. First establish whether the operation had side effects or whether the socket is still usable under the calling API's contract.
  • For new code, prefer explicit nonblocking or overlapped I/O with an event/completion path rather than cancelling a legacy blocking call.

Microsoft: connect · Microsoft: Winsock error codes · The Open Group: socket model


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