Socket Exception Codes
The table below lists the Windows Socket Error Codes with a brief explanation of what they mean.
For a more in-depth description please refer to the Microsoft resource on this topic:
https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
| Value | Return Code | Description |
| 6 | WSA_INVALID_HANDLE | Insufficient memory available. |
| 8 | WSA_NOT_ENOUGH_MEMORY | One or more parameters are invalid. |
| 87 | WSA_INVALID_PARAMETER | An application used a Windows Sockets function which directly maps to a Windows function which is indicating a problem with one or more parameters. |
| 995 | WSA_OPERATION_ABORTED | An overlapped operation was canceled due to the closure of the socket, or the execution of the SIO_FLUSH command in WSAIoctl |
| 996 | WSA_IO_INCOMPLETE | The application has tried to determine the status of an overlapped operation which is not yet completed. |
| 997 | WSA_IO_PENDING | The application has initiated an overlapped operation that cannot be completed immediately. |
| 10004 | WSAEINTR | A blocking operation was interrupted by a call to WSACancelBlockingCall. |
| 10009 | WSAEBADF | The file handle supplied is not valid. |
| 10013 | WSAEACCES | An attempt was made to access a socket in a way forbidden by its access permissions. |
| 10014 | WSAEFAULT | The system detected an invalid pointer address in attempting to use a pointer argument of a call. |
| 10022 | WSAEINVAL | Some invalid argument was supplied. |
| 10024 | WSAEMFILE | Too many open sockets. |
| 10035 | WSAEWOULDBLOCK | Resource temporarily unavailable. |
| 10036 | WSAEINPROGRESS | A blocking operation is currently executing. |
| 10037 | WSAEALREADY | An operation was attempted on a nonblocking socket with an operation already in progress |
| 10038 | WSAENOTSOCK | An operation was attempted on something that is not a socket. |
| 10039 | WSAEDESTADDRREQ | A required address was omitted from an operation on a socket. |
| 10040 | WSAEMSGSIZE | A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself. |
| 10041 | WSAEPROTOTYPE | Protocol wrong type for socket. |
| 10042 | WSAENOPROTOOPT | Bad protocol option. |
| 10043 | WSAEPROTONOSUPPORT | The requested protocol has not been configured into the system, or no implementation for it exists. |
| 10044 | WSAESOCKTNOSUPPORT | The support for the specified socket type does not exist in this address family. |
| 10045 | WSAEOPNOTSUPP | The attempted operation is not supported for the type of object referenced. |
| 10046 | WSAEPFNOSUPPORT | Protocol family not supported. |
| 10047 | WSAEAFNOSUPPORT | An address incompatible with the requested protocol was used. |
| 10048 | WSAEADDRINUSE | Address already in use. |
| 10049 | WSAEADDRNOTAVAIL | The requested address is not valid in its context. |
| 10050 | WSAENETDOWN | A socket operation encountered a dead network. This could indicate a serious failure of the network system, the network interface, or the local network itself. |
| 10051 | WSAENETUNREACH | A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host. |
| 10052 | WSAENETRESET | The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. |
| 10053 | WSAECONNABORTED | An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error. |
| 10054 | WSAECONNRESET | An existing connection was forcibly closed by the remote host. |
| 10055 | WSAENOBUFS | An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. |
| 10056 | WSAEISCONN | A connect request was made on an already-connected socket. |
| 10057 | WSAENOTCONN | A request to send or receive data was disallowed because the socket is not connected and no address was supplied. |
| 10058 | WSAESHUTDOWN | A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. |
| 10059 | WSAETOOMANYREFS | Too many references to some kernel object. |
| 10060 | WSAETIMEDOUT | A connection attempt failed because the connected party did not properly respond after a period of time. |
| 10061 | WSAECONNREFUSED | No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host. |
| 10062 | WSAELOOP | Cannot translate a name. |
| 10063 | WSAENAMETOOLONG | A name component or a name was too long. |
| 10064 | WSAEHOSTDOWN | A socket operation failed because the destination host is down or dead. |
| 10065 | WSAEHOSTUNREACH | No route to host. |
| 10066 | WSAENOTEMPTY | Cannot remove a directory that is not empty. |
| 10067 | WSAEPROCLIM | Too many processes; the number of applications that can use this socket simultaneously has been reached. |
| 10068 | WSAEUSERS | Ran out of user quota. |
| 10069 | WSAEDQUOT | Ran out of disk quota. |
| 10070 | WSAESTALE | The file handle reference is no longer available. |
| 10071 | WSAEREMOTE | The item is not available locally. |
| 10091 | WSASYSNOTREADY | This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. |
| 10092 | WSAVERNOTSUPPORTED | The current Windows Sockets implementation does not support the Windows Sockets specification version requested by the application. Check that no old Windows Sockets DLL files are being accessed. |
| 10093 | WSANOTINITIALISED | Successful WSAStartup not yet performed. |
| 10101 | WSAEDISCON | Graceful shutdown in progress. |
| 10102 | WSAENOMORE | No more results can be returned by the WSALookupServiceNext function. |
| 10103 | WSAECANCELLED | A call to the WSALookupServiceEnd function was made while this call was still processing. The call has been canceled. |
| 10104 | WSAEINVALIDPROCTABLE | The service provider procedure call table is invalid. A service provider returned a bogus procedure table to Ws2_32.dll. This is usually caused by one or more of the function pointers being NULL. |
| 10105 | WSAEINVALIDPROVIDER | The requested service provider is invalid. This error is returned if the protocol entry specified could not be found, or the service provider returned a version number other than 2.0. |
| 10106 | WSAEPROVIDERFAILEDINIT | The requested service provider could not be loaded or initialized. |
| 10107 | WSASYSCALLFAILURE | A system call that should never fail has failed. This is a generic error code, returned under various conditions. |
| 10108 | WSASERVICE_NOT_FOUND | No such service is known. The service cannot be found in the specified name space. |
| 10109 | WSATYPE_NOT_FOUND | The specified class was not found. |
| 10110 | WSA_E_NO_MORE | No more results can be returned by the WSALookupServiceNext function. |
| 10111 | WSA_E_CANCELLED | A call to the WSALookupServiceEnd function was made while this call was still processing. The call has been canceled. |
| 10112 | WSAEREFUSED | A database query failed because it was actively refused. |
| 11001 | WSAHOST_NOT_FOUND | No such host is known. The name is not an official host name or alias, or it cannot be found in the database(s) being queried. This error may also be returned for protocol and service queries, and means that the specified name could not be found in the relevant database. |
| 11002 | WSATRY_AGAIN | This is usually a temporary error during host name resolution and means that the local server did not receive a response from an authoritative server. A retry at some time later may be successful. |
| 11003 | WSANO_RECOVERY | This indicates that some sort of nonrecoverable error occurred during a database lookup. This may be because the database files (for example, BSD-compatible HOSTS, SERVICES, or PROTOCOLS files) could not be found, or a DNS request was returned by the server with a severe error. |
| 11004 | WSANO_DATA | The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. |
| 11005 | WSA_QOS_RECEIVERS | At least one QoS reserve has arrived. |
| 11006 | WSA_QOS_SENDERS | At least one QoS send path has arrived. |
| 11007 | WSA_QOS_NO_SENDERS | There are no QoS senders. |
| 11008 | WSA_QOS_NO_RECEIVERS | There are no QoS receivers. |
| 11009 | WSA_QOS_REQUEST_CONFIRMED | The QoS reserve request has been confirmed. |
| 11010 | WSA_QOS_ADMISSION_FAILURE | A QoS error occurred due to lack of resources. |
| 11011 | WSA_QOS_POLICY_FAILURE | The QoS request was rejected because the policy system couldn't allocate the requested resource within the existing policy. |
| 11012 | WSA_QOS_BAD_STYLE | An unknown or conflicting QoS style was encountered. |
| 11013 | WSA_QOS_BAD_OBJECT | A problem was encountered with some part of the filterspec or the provider-specific buffer in general. |
| 11014 | WSA_QOS_TRAFFIC_CTRL_ERROR | An error with the underlying traffic control (TC) API as the generic QoS request was converted for local enforcement by the TC API. This could be due to an out of memory error or to an internal QoS provider error. |
| 11015 | WSA_QOS_GENERIC_ERROR | A general QoS error. |
| 11016 | WSA_QOS_ESERVICETYPE | An invalid or unrecognized service type was found in the QoS flowspec. |
| 11017 | WSA_QOS_EFLOWSPEC | An invalid or inconsistent flowspec was found in the QOS structure. |
| 11018 | WSA_QOS_EPROVSPECBUF | An invalid QoS provider-specific buffer. |
| 11019 | WSA_QOS_EFILTERSTYLE | An invalid QoS filter style was used. |
| 11020 | WSA_QOS_EFILTERTYPE | An invalid QoS filter type was used. |
| 11021 | WSA_QOS_EFILTERCOUNT | An incorrect number of QoS FILTERSPECs were specified in the FLOWDESCRIPTOR. |
| 11022 | WSA_QOS_EOBJLENGTH | An object with an invalid ObjectLength field was specified in the QoS provider-specific buffer. |
| 11023 | WSA_QOS_EFLOWCOUNT | An incorrect number of flow descriptors was specified in the QoS structure. |
| 11024 | WSA_QOS_EUNKOWNPSOBJ | An unrecognized object was found in the QoS provider-specific buffer. |
| 11025 | WSA_QOS_EPOLICYOBJ | An invalid policy object was found in the QoS provider-specific buffer. |
| 11026 | WSA_QOS_EFLOWDESC | An invalid QoS flow descriptor was found in the flow descriptor list. |
| 11027 | WSA_QOS_EPSFLOWSPEC | An invalid or inconsistent flowspec was found in the QoS provider-specific buffer. |
| 11028 | WSA_QOS_EPSFILTERSPEC | An invalid FILTERSPEC was found in the QoS provider-specific buffer. |
| 11029 | WSA_QOS_ESDMODEOBJ | An invalid shape discard mode object was found in the QoS provider-specific buffer. |
| 11030 | WSA_QOS_ESHAPERATEOBJ | An invalid shaping rate object was found in the QoS provider-specific buffer. |
| 11031 | WSA_QOS_RESERVED_PETYPE | A reserved policy element was found in the QoS provider-specific buffer. |