WSANtohl  7CBJB8E 

The Windows Sockets WSANtohl function converts a u_long from network byte order to host byte order.

int WSANtohl (

    SOCKET s,

 

    u_long netlong,

 

    u_long FAR * lphostlong

 

   );

 

 

Parameters

s

[in] A descriptor identifying a socket.

netlong

[in] A 32-bit number in network byte order.

lphostlong

[out] A pointer to a 32-bit number in host byte order.

 

Remarks

This routine takes a 32-bit number in the network byte order associated with socket s and returns a 32-bit number pointed to by the lphostlong parameter in host byte order.

Return Values

If no error occurs, WSANtohl returns zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code may be retrieved by calling WSAGetLastError.

Error Codes

WSANOTINITIALISED

A successful WSAStartup must occur before using this function.

WSAENETDOWN

The network subsystem has failed.

WSAENOTSOCK

The descriptor is not a socket.

WSAEFAULT

The lphostlong argument is not totally contained in a valid part of the user address space.

 

See Also

htonl, htons, ntohl, ntohs, WSAHtonl, WSAHtons, WSANtohs