开发者

Bytes alignment when sending packets

If I send a packet containing address, port and other stuff, would there be any alignment proble开发者_如何学Cm on the other side? (using socks 5 protocol)


You don't mention which language you're programming in. If you're using C or C++, there are functions like htons, htonl, ntohs, ntohl and more to standardize network data elements into a transportable format. This guide (among many others) will tell you how to write network portable code so differences in endianness will not bite you in the @ss.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜