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

Cannot add DownloadProgressListener in v2.0 #220

Closed AntonAleksandrov13 closed 6 years ago

AntonAleksandrov13 commented 6 years ago

Seems like method public void addDownloadProgressListener(DownloadProgressListener listener) in SharedTorrent is already implemented, but I cannot find the way to use it. In my case, I am working with SimpleClient object.

Thanks for help in advance!

Dead-off commented 6 years ago

addDownloadProgressListener is deprecated method. I removed it right now. Also i updated library and you can use simpleClient.downloadTorrentAsync method which returns TorrentManager instance. You can add listeners to torrent manager and monitoring some state

//init simpleClient how earlier

TorrentManager torrentManager = client.downloadTorrentAsync();
torrentManager.addListener(new TorrentListenerWrapper() {
    //override methods here. For more information see TorrentListener
});
Dead-off commented 6 years ago

btw thank you for feedback!:)

AntonAleksandrov13 commented 6 years ago

Thank you for the quick response and help!