htons

htons converts a u_short IPv4 address in host byte order to TCP/IP network byte order.

Syntax

Copy
u_short WSAAPI htons(
    [in]    u_short hostshort
);

Parameters

[in] hostshort

A 16-bit number in host byte order.

Return Value

The value supplied in the hostshort parameter in TCP/IP network byte order.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

winsock2.h

RttcpipApi.lib