This commit is contained in:
zzy 2023-10-22 21:17:43 +08:00
parent 4182e3e917
commit 9d77446f68

View File

@ -59,7 +59,7 @@
#if WIN_PART
#include <winsock2.h>
#include <WS2tcpip.h>
#include <ws2tcpip.h>
#include <windows.h>
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
@ -341,16 +341,17 @@ static inline void get_sock_err(char* buff_128, size_t buff_len, int errcode) {
// ERR_SOCK_CONNECT,
// };
//https://learn.microsoft.com/zh-cn/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo?redirectedfrom=MSDN
//错误值 WSA 等效项 说明
//EAI_AGAIN WSATRY_AGAIN 名称解析暂时失败。
//EAI_BADFLAGS WSAEINVAL 为 pHints 参数的 ai_flags 成员提供了无效值。
//EAI_FAIL WSANO_RECOVERY 名称解析中发生不可恢复的失败。
//EAI_FAMILY WSAEAFNOSUPPORT 不支持 pHints 参数的 ai_family 成员。
//EAI_MEMORY WSA_NOT_ENOUGH_MEMORY 内存分配失败。
//EAI_NONAME WSAHOST_NOT_FOUND 所提供的参数的名称未解析,或者未提供 pNodeName 和 pServiceName 参数。
//EAI_SERVICE WSATYPE_NOT_FOUND pHints 参数的指定ai_socktype成员不支持 pServiceName 参数。
//EAI_SOCKTYPE WSAESOCKTNOSUPPORT 不支持 pHints 参数的 ai_socktype 成员。
// https://learn.microsoft.com/zh-cn/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo?redirectedfrom=MSDN
// https://learn.microsoft.com/en-gb/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo?redirectedfrom=MSDN
// Error value WSA equivalent Description
// EAI_AGAIN WSATRY_AGAIN A temporary failure in name resolution occurred.
// EAI_BADFLAGS WSAEINVAL An invalid value was provided for the ai_flags member of the pHints parameter.
// EAI_FAIL WSANO_RECOVERY A nonrecoverable failure in name resolution occurred.
// EAI_FAMILY WSAEAFNOSUPPORT The ai_family member of the pHints parameter is not supported.
// EAI_MEMORY WSA_NOT_ENOUGH_MEMORY A memory allocation failure occurred.
// EAI_NONAME WSAHOST_NOT_FOUND The name does not resolve for the supplied parameters or the pNodeName and pServiceName parameters were not provided.
// EAI_SERVICE WSATYPE_NOT_FOUND The pServiceName parameter is not supported for the specified ai_socktype member of the pHints parameter.
// EAI_SOCKTYPE WSAESOCKTNOSUPPORT The ai_socktype member of the pHints parameter is not supported.
sprintf(buff_128, "%3d", errcode);
}
@ -367,6 +368,4 @@ static inline void sock_thread(void(*thread_func)(void*), void* data) {
#ifdef __cplusplus
}
#endif
#endif
#endif //_SSOCKET_H_