Windows Sockets Error Codes (Windows)
Windows Sockets Error Codes (Windows)
Most Windows Sockets 2 functions do not return the specific cause of an error when the function returns.
For information, see the Handling Winsock Errors topic.
The WSAGetLastError function returns the last error that occurred for the calling thread. When a
particular Windows Sockets function indicates an error has occurred, this function should be called
immediately to retrieve the extended error code for the failing function call. These error codes and a short
text description associated with an error code are defined in the Winerror.h header file. The
FormatMessage function can be used to obtain the message string for the returned error.
For information on how to handle error codes when porting socket applications to Winsock, see Error
Codes - errno, h_errno and WSAGetLastError.
The following list describes the possible error codes returned by the WSAGetLastError function. Errors are
listed in numerical order with the error macro name. Some error codes defined in the Winsock2.h header
file are not returned from any function.
Requirements
Winsock2.h;
Header
Winerror.h
See also
Error Codes - errno, h_errno and WSAGetLastError
Handling Winsock Errors
FormatMessage
WSAGetLastError
Community Additions