1. Winsock 錯誤碼
2.
Windows Sockets 錯誤碼及出錯原因
表格摘錄:
Windows Sockets錯誤碼 |
Berkeley 對應錯誤碼 |
錯誤號碼 |
解 釋 |
WSAEINTR |
EINTR |
10004 |
同標準C |
WSAEBADF |
EBADF |
10009 |
同標準C |
WSAEACCES |
EACCES |
10013 |
同標準C |
WSAEFAULT |
EFAULT |
10014 |
同標準C |
WSAEINVAL |
EINVAL |
10022 |
同標準C |
WSAEMFILE |
EMFILE |
10024 |
同標準C |
WSAEWOULDBLOCK |
EWOULDBLOCK |
10035 |
同BSD |
WSAEINPROGRESS |
EINPROGRESS |
10036 |
當一個阻塞函數進行中時,調用任何Windows Sockets API函數均返回此錯誤 |
WSAEALREADY |
EALREADY |
10037 |
同BSD |
WSAENOTSOCK |
ENOTSOCK |
10038 |
同BSD |
WSAEDESTADDRREQ |
EDESTADDRREQ |
10039 |
同BSD |
WSAEMSGSIZE |
EMSGSIZE |
10040 |
同BSD |
WSAEPROTOTYPE |
EPROTOTYPE |
10041 |
同BSD |
WSAENOPROTOOPT |
ENOPROTOOPT |
10042 |
同BSD |
WSAEPROTONOSUPPORT |
EPROTONOSUPPORT |
10043 |
同BSD |
WSAESOCKTNOSUPPORT |
ESOCKTNOSUPPORT |
10044 |
同BSD |
WSAEOPNOTSUPP |
EOPNOTSUPP |
10045 |
同BSD |
WSAEPFNOSUPPORT |
EPFNOSUPPORT |
10046 |
同BSD |
WSAEAFNOSUPPORT |
EAFNOSUPPORT |
10047 |
同BSD |
WSAEADDRINUSE |
EADDRINUSE |
10048 |
同BSD |
WSAEADDRNOTAVAIL |
EADDRNOTAVAIL |
10049 |
同BSD |
WSAENETDOWN |
ENETDOWN |
10050 |
同BSD。任何時候只要Windows Sockets實現檢測到網路子系統失敗,它就報告此錯誤。 |
WSAENETUNREACH |
ENETUNREACH |
10051 |
同BSD |
WSAENETRESET |
ENETRESET |
10052 |
同BSD |
WSAECONNABORTED |
ECONNABORTED |
10053 |
同BSD |
WSAECONNRESET |
ECONNRESET |
10054 |
同BSD |
WSAENOBUFS |
ENOBUFS |
10055 |
同BSD |
WSAEISCONN |
EISCONN |
10056 |
同BSD |
WSAENOTCONN |
ENOTCONN |
10057 |
同BSD |
WSAESHUTDOWN |
ESHUTDOWN |
10058 |
同BSD |
WSAETOOMANYREFS |
ETOOMANYREFS |
10059 |
同BSD |
WSAETIMEDOUT |
ETIMEDOUT |
10060 |
同BSD |
WSAECONNREFUSED |
ECONNREFUSED |
10061 |
同BSD |
WSAELOOP |
ELOOP |
10062 |
同BSD |
WSAENAMETOOLONG |
ENAMETOOLONG |
10063 |
同BSD |
WSAEHOSTDOWN |
EHOSTDOWN |
10064 |
同BSD |
WSAEHOSTUNREACH |
EHOSTUNREACH |
10065 |
同BSD |
WSASYSNOTREADY |
|
10091 |
由WSAStartup() 返回,指示網路子系統無法使用。 |
WSAVERNOTSUPPORTED |
|
10092 |
由WSAStartup() 返回,指示Windows Sockets DLL 不能支援此應用程式。 |
WSANOTINITIALISED |
|
10093 |
由除WSAStartup()之外的其它函數返回,指示 尚沒有一次成功的WSAStartup() 調用執行過。 |
WSAEDISCON |
|
10101 |
由WSARecv()和WSARecvFrom()返回,指示遠程方已經初始化了一個“雅緻”的shutdown序列。 |
WSAHOST_NOT_FOUND |
HOST_NOT_FOUND |
11001 |
同BSD |
WSATRY_AGAIN |
TRY_AGAIN |
11002 |
同BSD |
WSANO_RECOVERY |
NO_RECOVERY |
11003 |
同BSD |
WSANO_DATA |
NO_DATA |
11004 |
同BSD |
3.
關於Winsock error number: 10053 WSAECONNABORTED 的幾種不同解釋
部分摘錄:
Berkeley description: A connection abort was caused internal to your host machine. The software caused a connection abort because there is no space on the socket's queue and the socket cannot receive further connections.
WinSock description: Partly the same as Berkeley. The error can occur when the local network system aborts a connection. This would occur if WinSock aborts an established connection after data retransmission fails (receiver never acknowledges data
sent on a datastream socket).
TCP/IP scenario: A connection will timeout if the local system doesn't receive an (ACK)nowledgement for data sent. It would also timeout if a (FIN)ish TCP packet is not ACK'd (and even if the FIN is ACK'd, it will eventually timeout if a FIN is not
returned).