title: Does any uniform function exists instead of htons htonl
body: <p>I am trying new the C++ socket programming. I am having some difficulty for understanding functionality of htons, htonl and related functions. I read some documents but still my questions are as follows,</p>
  
  <p>for a single server and and single client I am using htons both side for the port number and the code is working fine. Even if I don't use these functions and both my server-clients are Intel based 64 bit machines, the codes are working fine. But what if multiple clients try to connect my server and the clients use different data storage format. For example, x86 is little-endian and ARM A-53 is both little- and big-endian and others, where some of them are 32 bits, 16 bits or 64 bits etc. My server is 64 bits. So I'm now confused which functions I have to use that uniformly serves all purpose ? Or, I have to always detect the client type and convert it's data format (port number) to 64 bit (as my server is 64 bit) and then use htonl() function to reach the server. It would be great someone please reply or points me out if I am on the wrong path ...</p>