Convert short integers from host to network byte order

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
integer = %SS_HTONS(hostshort)

Return value


Returns a short integer in network byte order. (i2)



A short integer in host byte order. (i2)


%SS_HTONS converts 16‑bit (short) unsigned integers from host byte order to network byte order.

Host byte order is the format in which bytes are ordered internally on a specific host. Network byte order is the format in which data bytes are supposed to be transmitted through a network. All hosts on a network must send data in network byte order. If your host does not have an internal data representation format identical to the network byte order, you must use %SS_HTONL.


In the Synergy socket API, all IP address and port arguments (in_addr and in_port) are in host byte order, and should not be converted to network byte order. The %SS_HTONS function should only be used when sending portable data over the network.