Actually, I understand that the network order and the order of the host is different. I wonder when you need a short and why use it? (In the head "neponyatka").
In IPv4, the host address is 4 bytes in size; htonl () and int variables must be used for it (on 32-bit machines, you can long. 16-bit ones, for simplicity, forget it).
The port address in IP is 2 bytes in size, respectively htons () and short.
Host and port addresses are transmitted over the network and their bits must be ordered in a uniform manner.
short (2 bytes) int (on some platforms 4 bytes) long (8 bytes) are data types (size). Why these data types? Well, programmers tend to use different types of data in their programs. :)
Type is not size. This is a meaning.
short and long is a relic of BSD. In general, I advise you to read Stevens, so that there are less "misunderstandings" And yes, short and long are not byte order.