The htons function converts a value of type u_short from host to TCP/IP network byte order (which is big-endian).
The system include file WinSock2.inc contains the following declarations for the u_short type, and the htonl function:
u_short = shortint;
function htonl(hostlong : u_long) : u_long;
external dll='ws2_32.dll';
The only argument passed to the htons function is the u_short value that you want to convert to TCP/IP network byte order.
The htons function returns the u_short value in TCP/IP network byte order.
The authoritative source of information about the WinSock2 library is the Microsoft Developers Network (MSDN). You can access the MSDN on the Microsoft website at msdn.microsoft.com.