Discussion:
[libtorrent] Finding seeds
Murray S. Kucherawy
2017-06-09 20:59:20 UTC
Permalink
In a closed system, before a torrent shuts down I'd like to get a list of
complete seeds that I can see out there. The purpose of this is to decide
if I should stick around and serve others for a while, or if there seem to
be enough seeds already.

As far as I know, the simplest way to do this is to walk the list returned
by get_peer_info() and look for the ones that have the "seed" flag set.
However, it seems as though doing so right as the torrent completes isn't
sufficient because seeds might disconnect between getting to that state and
me walking the peer list. I've tried doing a status post every second and
walking the peer list then, but if the torrent takes less than a second to
complete, the status post may not come in time.

Is there a more reliable way to get this information?

-MSK
Murray S. Kucherawy
2017-06-09 21:15:57 UTC
Permalink
Post by Murray S. Kucherawy
In a closed system, before a torrent shuts down I'd like to get a list of
complete seeds that I can see out there. The purpose of this is to decide
if I should stick around and serve others for a while, or if there seem to
be enough seeds already.
As far as I know, the simplest way to do this is to walk the list returned
by get_peer_info() and look for the ones that have the "seed" flag set.
However, it seems as though doing so right as the torrent completes isn't
sufficient because seeds might disconnect between getting to that state and
me walking the peer list. I've tried doing a status post every second and
walking the peer list then, but if the torrent takes less than a second to
complete, the status post may not come in time.
Is there a more reliable way to get this information?
Ah this is pretty similar to a previous thread ("Accurate peer list based
on alerts") from a few weeks back. Apologies for not seeing it.

-MSK
Arvid Norberg
2017-06-09 22:46:09 UTC
Permalink
Post by Murray S. Kucherawy
Post by Murray S. Kucherawy
In a closed system, before a torrent shuts down I'd like to get a list of
complete seeds that I can see out there. The purpose of this is to
decide
Post by Murray S. Kucherawy
if I should stick around and serve others for a while, or if there seem
to
Post by Murray S. Kucherawy
be enough seeds already.
Keep in mind that, by default, close_redundant_connections is true. This
means, if you're a seed, all peers that are also seeds will be disconnected.

get_peer_info() will only tell you about peers you're connected to, and is
likely going to underreport seeds.

It may be more reliable to use scrape information from trackers or the DHT.
--
Arvid Norberg
Loading...