htons

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

Syntax

Copy
u_short WSAAPI htons(
    u_short hostshort
);

Parameters

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

eRTOS 1.0 SDK

Winsock2.h RtTcpipApi.lib