From 9d77446f68fb7373bb148ed64547a572222416d9 Mon Sep 17 00:00:00 2001 From: zzy <2450266535@qq.com> Date: Sun, 22 Oct 2023 21:17:43 +0800 Subject: [PATCH] hot fix --- ssocket.h | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/ssocket.h b/ssocket.h index c4005be..481226b 100644 --- a/ssocket.h +++ b/ssocket.h @@ -59,7 +59,7 @@ #if WIN_PART #include -#include +#include #include #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 \ No newline at end of file +#endif //_SSOCKET_H_ \ No newline at end of file