主机字节序与网络字节序

网络字节序为big endian
x86主机字节序为little endian

网络字节序转为主机字节序
socket.ntohl(x)
socket.ntohs(x)

主机字节序转为网络字节序
socket.htonl(x)
socket.htons(x)

猜你喜欢

转载自blog.csdn.net/weixin_44311188/article/details/85377510
今日推荐