mafintosh / torrent-stream

The low level streaming torrent engine that peerflix uses
MIT License
1.94k stars 228 forks source link

Seed torrent when done #66

Open BastienClement opened 10 years ago

BastienClement commented 10 years ago

Once a torrent is fully downloaded, torrent-stream should switch into a seed-mode until destroyed in order to be a better swarm citizen.

mafintosh/peerflix/issues/58 popcorn-official/popcorn-app/issues/80 asapach/peerflix-server/issues/6

It will still be stoppable once pause/resume functionnality is implemented https://github.com/mafintosh/torrent-stream/issues/49.

asapach commented 10 years ago

In my experience it depends on the health of the torrent: when there are few seeders, t-s seeds just fine even after completing the download. The issue is probably caused by the fact that peerflix and peerflix-server don't listen for incoming connections and as the result peers can't break through. This raises the NAT issues like port mapping, nat-upnp and nat-pmp.

BastienClement commented 10 years ago

I opened this issue after reading (from @mafintosh in the peerflix repo)

Yeah - it's probably torrent-stream has a choke timeout that is triggered since we do not wan't any more data. torrent-stream then disconnects the peer. It probably shouldn't do this when it is seeding.

I agree however that low-seeded torrent keep uploading when completed.

This is maybe only a misconception due to well-seeded torrents + engine.swarm.pause() + NAT.