WSAGetLastError

WSAGetLastError gets the status for the last Winsock operation that failed.

Syntax

int WSAGetLastError(void);

Parameters

None.

Return Value

The last network error that occurred within the calling thread

Functions can set this value by calling WSASetLastError.

Remarks

To reset the error code, use WSASetLastError with iError set to zero. getsockopt SO_ERROR also resets the error code to zero.

Requirements

Minimum Supported Version RTX64 2013
Header Winsock2.h
Library RtTcpip.lib