Bittorrent protocol TCP communication example

社会主义新天地 提交于 2019-12-04 21:46:21

s.recv(4096)

You're just reading an block of data of some unspecified length, presumably whatever is in the TCP buffer.

Bittorrent is message-based. TCP is a stream of bytes, which means it does not nicely chop the data sent by the remote peer into messages, you will have to do that yourself.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!