在哪里可以找到这些代码表示的值?
在一个非套接字上尝试了一个操作
无法立即完成一个非阻挡性套接字操作。
WSAENOTSOCK
(10038)
Socket operation on non-socket.
An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.
在WINSOCK2.H 定义了这些错误码,在MSDN上有解释
无法立即完成一个非阻挡性套接字操作。
使用这段代码,将出错代码转换成语言描述
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
// Process any inserts in lpMsgBuf.
// ...
// Display the string.
AfxMessageBox((LPCTSTR)lpMsgBuf);
// Free the buffer.
LocalFree( lpMsgBuf );
An operation was attempted on something that is not a socket.
vc的工具中有一个error lookup的工具,不过你装vc的时候得选tool