ntohs()

convert a 16-bit value from network byte order to host byte order

Synopsis:

#include <netinet/in.h>

unsigned short ntohs( unsigned short netshort );

Description:

This function converts a 16-bit value from network byte order to host byte order.

This routine is most often used in conjunction with Internet addresses and ports returned by gethostbyname() and getservent().

Returns:

The value in host byte order.

Classification:

POSIX 1003.1g (draft)

Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

gethostbyname(), getservent(), htonl(), htons(), ntohl()