title: Using htonl/ntohl on a 32 bit integer that will be sent over a socket
body: <p>When I look up examples for htonl, it always returns a <strong>uint32_t</strong>. However, when I call htonl in VS2015 using Winsock2.h, it returns a <strong>u_long</strong>. </p>
  
  <p>On my machine, when I compile for 32 bit and for 64 bit, I get that the size of a u_long is 4 bytes. I read online, that in a 64 bit architecture a long should be 8 bytes. Will this ever be the case? I am worried that I will have compatibility issues if a u_long is not the same amount of bytes as uint32_t when the data is to be sent over the socket.</p>
  
  <p>TL;DR - Will a u_long always be 4 bytes? If not, how should you reliably send a 32 bit integer over a socket?</p>