IPAddress.HostToNetworkOrder Method (Int16)
Converts a short value from host byte order to network byte order.
[Visual Basic] Overloads Public Shared Function HostToNetworkOrder( _ ByVal host As Short _ ) As Short [C#] public static short HostToNetworkOrder( short host ); [C++] public: static short HostToNetworkOrder( short host ); [JScript] public static function HostToNetworkOrder( host : Int16 ) : Int16;
- The number to convert, expressed in host byte order.
A short value, expressed in network byte order.
Different computers use different conventions for ordering the bytes within multibyte integer values. Some computers put the most significant byte first (known as big-endian order) and others put the least-significant byte first (known as little-endian order). To work with computers that use different byte ordering, all integer values sent over the network are sent in network byte order.
The HostToNetworkOrder method converts multibyte integer values stored on the host system from the byte order used by the host to the byte order used by the network.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard