Inside <arpa/inet.h>
, there are two functions to convert host byte order to network byte order. Why are there two options? I understand that htons()
is used for port address related to IPv4 and IPv6, but what use does htonl()
serve?
Inside <arpa/inet.h>
, there are two functions to convert host byte order to network byte order. Why are there two options? I understand that htons()
is used for port address related to IPv4 and IPv6, but what use does htonl()
serve?
I don’t usually use networking in C or C++, so I can’t say for sure. But I did I find this quote that might explain it: