htons()

convert 16-bit values between host and network byte order 

Function


SYNOPSIS

#include <machine/endian.h>

unsigned short htons(unsigned short hostshort);


DESCRIPTION

This subroutine converts values between the host and network byte order. Specifically, htons() converts 16-bit quantities from host byte order to network byte order.


PARAMETERS

hostshort 

Specifies the 16-bit quantity.


RETURN VALUES

htons() returns network byte order of hostshort.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
htonl(), ntohl(), ntohs()


PTC MKS Toolkit 10.4 Documentation Build 39.