mpetazzoni / ttorrent

BitTorrent Java library with tracker and download client
http://mpetazzoni.github.com/ttorrent/
Apache License 2.0
1.38k stars 502 forks source link

Could not read message from peer #29

Closed abdalim closed 11 years ago

abdalim commented 11 years ago

Hi, testing ttorrent with the clients on 2 Android phones (1 as leecher and 1 as seeder) and the tracker on a Mac. Keep getting this "Could not read message from peer..." on the client which is trying to download the file from the seeder. Below is the log I got from the leecher and most of the logs are repetitions of these lines.

2013-01-18 11:13:36,969 [bt-announce(..643732)    ] INFO : Announcing to tracker with 0U/0D/1707011L bytes...
2013-01-18 11:13:37,113 [bt-announce(..643732)    ] INFO : Got 1 peer(s) in tracker response.
2013-01-18 11:13:37,114 [bt-announce(..643732)    ] DEBUG: Found peer (by host ID): peer://127.0.0.1:6881/643732 [Ci|Ci].
2013-01-18 11:13:37,116 [bt-connect-10            ] INFO : Connecting to peer://127.0.0.1:6881/643732 [Ci|Ci]...
2013-01-18 11:13:37,118 [bt-connect-10            ] INFO : Connected. Sending handshake to peer://127.0.0.1:6881/643732 [Ci|Ci]...
2013-01-18 11:13:37,119 [bt-connect-10            ] INFO : Sent handshake (68 bytes), waiting for response...
2013-01-18 11:13:37,121 [bt-connect-10            ] INFO : Reading handshake size (1 byte) from localhost:6881+...
2013-01-18 11:13:37,125 [bt-serve                 ] DEBUG: New incoming connection, waiting for handshake...
2013-01-18 11:13:37,127 [bt-serve                 ] INFO : Reading handshake size (1 byte) from localhost:38596+...
2013-01-18 11:13:37,128 [bt-serve                 ] INFO : Replied to localhost:38596+ with handshake (68 bytes).
2013-01-18 11:13:37,129 [bt-serve                 ] INFO : Handling new peer connection with peer://127.0.0.1:38596/643732...
2013-01-18 11:13:37,130 [bt-serve                 ] DEBUG: Peer peer://127.0.0.1:6881/643732 [Ci|Ci] went away with 0 piece(s) [0/0/4].
2013-01-18 11:13:37,130 [bt-connect-10            ] INFO : Handshaked with peer://127.0.0.1:6881/643732 [Ci|Ci], peer ID is 2D544F303034322D343733336331393131643732.
2013-01-18 11:13:37,133 [bt-connect-10            ] INFO : Handling new peer connection with peer://127.0.0.1:6881/643732...
2013-01-18 11:13:37,134 [bt-serve                 ] DEBUG: Started peer exchange with peer://127.0.0.1:6881/643732 [Ci|Ci] for 20130110_122339.jpg.
2013-01-18 11:13:37,135 [bt-serve                 ] DEBUG: New peer connection with peer://127.0.0.1:6881/643732 [Ci|Ci] [1/32].
2013-01-18 11:13:37,136 [bt-connect-10            ] INFO : Already connected with peer://127.0.0.1:6881/643732 [Ci|Ci], closing link.
2013-01-18 11:13:37,138 [bt-peer(..643732)-recv   ] DEBUG: Could not read message from peer://127.0.0.1:6881/643732 [Ci|Ci]: Reached end-of-stream while reading size header
2013-01-18 11:13:37,139 [bt-peer(..643732)-recv   ] DEBUG: Peer exchange with peer://127.0.0.1:6881/643732 [Ci|Ci] closed.
2013-01-18 11:13:37,140 [bt-peer(..643732)-recv   ] DEBUG: Peer peer://127.0.0.1:6881/643732 [Ci|Ci] went away with 0 piece(s) [0/0/4].
2013-01-18 11:13:37,140 [bt-peer(..643732)-recv   ] DEBUG: Peer peer://127.0.0.1:6881/643732 [Ci|Ci] disconnected, [0/32].
2013-01-18 11:13:38,264 [bt-client(..643732)      ] INFO : SHARING 0/4 pieces (0.00%) [0/0] with 0/32 peers at 0.00/0.00 kB/s.

Am I wrong to assume that it would work on the Android phones? Cheers.

abdalim commented 11 years ago

Ah, should have realised the loopback address, now it's working, thanks for the marvellous library :+1: