mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-02 14:12:18 +00:00
Peer discovery with mDNS can be very slow, particularly if the first mDNS query is lost. This patch resolves it by adjusting the timer with an adaptive initial interval. We start with a very short timer (500 ms). If a peer is discovered before the end of the timer, then the timer is reset to the normal query interval value (300s), otherwise the timer's value is multiplied by 2 until it reaches the normal query interval value. Related: https://github.com/libp2p/rust-libp2p/pull/3323. Resolves: https://github.com/libp2p/rust-libp2p/issues/3319. Pull-Request: #3975.