[bittorrent] About class SingleDownload
yang.yguo at gmail.com
Mon Nov 21 12:17:00 EST 2005
I did some source code reading on BitTorrent, and have some questions
regarding the class SingleDownload in Downloader.py.
If I understand correctly, the class SingleDownload handles one
peer-to-peer connection, i.e., it handles the message exchange between
the user (the local peer) and one of its (remote) peers.
Some of the member functions are:
disconnected(): disconnect the connection
_letgo(): cancel the active requests for this peer. Request these
pieces from other remote peers.
got_(un)choked(): the remote peer (un)choke the connection
got_piece(): receive the "piece" message from the remote peer
_request_more(): the user sends the request to remote peer
got_have(): receive the "have" message from the remote peer
_want(): return TRUE if user want this piece
Please comment if you think the above statement is not correct. Also,
I didn't find the function that handles the incoming "request" message
from the remote peer. Does anybody know how it is handled? Thanks.
More information about the BitTorrent