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

how to be a seeder,when i creat a .torrent? #245

Closed Peterppan closed 5 years ago

Dead-off commented 5 years ago

just add a torrent to the communication manager using addTorrent method with downloadDirPath parameter= Seeder is a just peer which has all pieces of the torrent. When you add a new torrent, the library scans downloadDir and calculates existing pieces. This peer will seed all existing pieces. You can see some examples in CommunicationManagerTest class. E.g. large_file_download() test creates a file with size about 200mb, runs tracker and two clients. Then second peer downloads the file from first peer

Peterppan commented 5 years ago

Thank you again for your help,I place the whole file into the client path,and the other client download success. But I find another problem, I create the tracker and client in a pc ,another client is a android machine which run app using this jar. I can download success from android to the pc.On the contrary,it not.It only create a .part file and the tracker RequestEvent event: NONE. I restar the app ,wait for a while ,the tracker RequestEvent event: COMPLETED. But the file till .part. then ,i copy the .part file and remove suffix name (.part) ,this file data is corrected. (ps. ths file is a excel file so i can konw the data is right) I try to find why?If you have some suggest plase tell me ,thanks.

Peterppan commented 5 years ago

I find the reason,this project use Apache Commons IO-2.1,and my app uss Apache Commons IO-1.3.The Apache Commons IO-1.3 have't the method FileUtils.deleteQuietly .So when the program run finish in FileStorage is not wroking. I change the app Apache Commons IO version to 2.1 is work welll. Finally,thanks for your help!

Peterppan commented 5 years ago

the problem is solved.