Common Winsock Error Codes
Winsock functions return error codes when an operation fails. Below is a list of the most frequently encountered errors.
Error Code | Name | Description |
---|---|---|
10004 | WSAEINTR | Interrupted function call. |
10009 | WSAEBADF | File descriptor is not a socket. |
10013 | WSAEACCES | Permission denied. |
10014 | WSAEFAULT | Bad address. |
10022 | WSAEINVAL | Invalid argument. |
10035 | WSAEWOULDBLOCK | Resource temporarily unavailable. |
10036 | WSAEINPROGRESS | Operation now in progress. |
10037 | WSAEALREADY | Operation already in progress. |
10038 | WSAENOTSOCK | Socket operation on non-socket. |
10039 | WSAEDESTADDRREQ | Destination address required. |
10040 | WSAEMSGSIZE | Message too long. |
10041 | WSAEPROTOTYPE | Protocol wrong type for socket. |
10042 | WSAENOPROTOOPT | Bad protocol option. |
10043 | WSAEPROTONOSUPPORT | Protocol not supported. |
10044 | WSAESOCKTNOSUPPORT | Socket type not supported. |
10045 | WSAEOPNOTSUPP | Operation not supported. |
10046 | WSAEPFNOSUPPORT | Protocol family not supported. |
10047 | WSAEAFNOSUPPORT | Address family not supported by protocol family. |
10048 | WSAEADDRINUSE | Address already in use. |
10049 | WSAEADDRNOTAVAIL | Cannot assign requested address. |
10050 | WSAENETDOWN | Network is down. |
10051 | WSAENETUNREACH | Network is unreachable. |
10052 | WSAENETRESET | Network dropped connection on reset. |
10053 | WSAECONNABORTED | Software caused connection abort. |
10054 | WSAECONNRESET | Connection reset by peer. |
10055 | WSAENOBUFS | No buffer space available. |
10056 | WSAEISCONN | Socket is already connected. |
10057 | WSAENOTCONN | Socket is not connected. |
10058 | WSAESHUTDOWN | Cannot send after socket shutdown. |
10059 | WSAETOOMANYREFS | Too many references: cannot splice. |
10060 | WSAETIMEDOUT | Connection timed out. |
10061 | WSAECONNREFUSED | Connection refused. |
10062 | WSAELOOP | Cannot translate name. |
10063 | WSAENAMETOOLONG | Name too long. |
10064 | WSAEHOSTDOWN | Host is down. |
10065 | WSAEHOSTUNREACH | No route to host. |
10066 | WSAENOTEMPTY | Directory not empty. |
10067 | WSAEPROCLIM | Too many processes. |
10068 | WSAEUSERS | User quota exceeded. |
10069 | WSAEDQUOT | Disk quota exceeded. |
10070 | WSAESTALE | Stale file handle reference. |
10071 | WSAEREMOTE | Item is remote. |
For a complete list, see the official Microsoft Docs.