Ports and addresses are specified to sockets API calls by using the network-byte ordering convention. Network-byte order is also known as big endian byte ordering, which has the high-order byte at the starting address. By contrast, little endian has the low-order byte at the starting address. Using network-byte ordering for data exchanged between hosts allows hosts using different underlying byte ordering conventions to exchange address information. There is a set of network utility functions for translating addresses from host-byte to network-byte order and from network-byte to host-byte order. For more information about network-byte order and address translation, see:
Note: The socket interface does not handle application data byte ordering differences. Application writers must handle data buffer byte order differences themselves.