I'm stuck at stage 10, possibly related to previous steps or possibly a bug

The problem is that when I try to download a piece from a peer above index 2 (meaning the peers list has more than 3 peers), I get an error indicating that the addresses are wrong.

I investigated this issue further and found that I can’t get more than 3 peers from the tracker. This issue lies within the tracker’s response itself—the peers string length is always 18 bytes (indicating only 3 peers).

To demonstrate this, I printed the raw string response from the tracker and the addresses themselves. Then, I ran the test, which attempts to download a piece from the 9th peer (which isn’t available).

[tester::#ND2] Running tests for Stage #ND2 (Download a piece)
[tester::#ND2] Running ./your_bittorrent.sh download_piece -o /tmp/torrents3518647417/piece-9 /tmp/torrents3518647417/itsworking.gif.torrent 9
[your_program] d8:completei3e10:incompletei0e8:intervali60e12:min intervali60e5:peers18:�>U�%�>RY�ץ�!M��e
[your_program] Invalid address or address not supported: No error information
[your_program] Failed to connect to peer: :0
[your_program] Failed to perform handshake with peer :0
[tester::#ND2] Application didn't terminate successfully without errors. Expected 0 as exit code, got: 1
[tester::#ND2] Test failed

@hipsteromer the tracker should always be returning 3 or less peers. The number you’re seeing (9) is the piece index - all peers will have all pieces available, so you can talk to any peer to get a piece.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.