[bittorrent] [Bittorrent] Peer Wire Protocol silly question...

Justin Cormack justin at street-vision.com
Tue Sep 20 07:21:30 EDT 2005

On Tue, 2005-09-20 at 12:04 +0800, CS FYP 2005 wrote:
> i am implementing a small programme to communicate with other peers...
> i just get to get the information of the peers instead of download or
> upload anything to them...
> i think i can successfully send a handshake to the peer coz' my friend
> saw me in his peer list...
> will that peer also send me back a handshake after that?
> but i couldn't get any response from him...
> in fact what should be the message looks like?
> i mean for the other message in the peer wire protocol...
> for example, if i want to know a peer's bitfield...
> what will be the message i send him?

Its quite well documented in the protocol document.

There is no request bitfield - the peer should send it to you after the
handshake finishes. If not that means that the peer has no pieces. Is
the peer disconnecting? If so you have probably got an incorrect
handshake. If not the peer probably has no pieces. Try sending the
keepalive message (4 zero bytes) and see if you get that back from the

More information about the BitTorrent mailing list