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

download part in order? #101

Closed letroll closed 10 years ago

letroll commented 10 years ago

Please, can you tell me if that library can download the parts in the order?

AX-NICOLAS commented 10 years ago

yeah good idea !

mpetazzoni commented 10 years ago

Downloading parts in order goes against the point of the BitTorrent protocol. If everyone tries to download the first parts first, no one will get them.

The algorithm implemented in ttorrent follows some of the recommendations of the BitTorrent protocol spec and favors the least available pieces first to increase the overall availability of data amongst all seeders.

If you want though, it is fairly easy to change that algorithm and use a different algorithm. The piece selection happens there: https://github.com/mpetazzoni/ttorrent/blob/d243274ad77c098b2c5f2028b25f706313e3e479/src/main/java/com/turn/ttorrent/client/SharedTorrent.java#L648

letroll commented 10 years ago

thank you for your indication