文章目录 1 网络字节序转换函数 1 网络字节序转换函数 常用的网络字节序转换函数如下: #include <arpa/inet.h> uint32_t htonl(uint32_t hostlong); uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong); uint16_t ntohs(uint16_t netshort)