Getting peers quickly by announcing to the DHT frequently?

777 views Asked by At

I'm new to the BitTorrent protocols, so please be gentle.

From what I understand, torrents are supposed to announce to the DHT every 15 minutes, and by default, this is what libtorrent does. But what if I don't get any peers after the very first announcement? Do I have to wait 15 minutes till libtorrent gets its next chance to get a list of peers?

To avoid having to wait, I configured libtorrent to announce to the DHT every 3 seconds using:

session.set_settings({'dht_announce_interval': 3})

With this method, I successfully obtained a list of peers within 10 seconds. Is this the proper way to get peers quickly? If not, what's the proper way to get peers quickly from the DHT? Is this abuse?

1

There are 1 answers

2
the8472 On

Once you have your first batch of peers from the DHT or a tracker a secondary peer source called peer exchange (PEX) will kick in and will provide a frequently updated view available peers. This makes it unnecessary to set a low interval on the primary sources.