Skip Navigation
The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

Difference between htons() and htonl()?

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?

3
3 comments