![]() |
![]() |
![]() |
![]() |
Convert a 16-bit value from network-byte order to host-byte order
#include <netinet/in.h> in_port_t ntohs( in_port_t netshort );
socket3r.lib, socket3s.lib
The ntohs() function converts a 16-bit value from network-byte order to host-byte order. If a machine's byte order is the same as the network order, routines are defined as null macros.
This routine is most often used in conjunction with internet addresses and ports returned by gethostbyname() and getservent().
The value in host-byte order.
Standard Unix, POSIX 1003.1g (draft)
Safety: | |
---|---|
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |
gethostbyname(), getservent(), htonl(), htons(), ntohl()
![]() |
![]() |
![]() |
![]() |