Format comments

This commit is contained in:
Igor Katson 2024-11-28 09:58:44 +01:00
parent 90a823b3ed
commit c8cd17ce8e
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5

View file

@ -845,9 +845,13 @@ impl TorrentStateLive {
tx: PeerTx, tx: PeerTx,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
let mut sent_peers_live: HashSet<SocketAddr> = HashSet::new(); let mut sent_peers_live: HashSet<SocketAddr> = HashSet::new();
const MAX_SENT_PEERS: usize = 50; // As per BEP 11 we should not send more than 50 peers at once (here it also applies to fist message, should be OK as we anyhow really have more) // As per BEP 11 we should not send more than 50 peers at once
const PEX_MESSAGE_INTERVAL: Duration = Duration::from_secs(60); // As per BEP 11 recommended interval is min 60 seconds // (here it also applies to fist message, should be OK as we anyhow really have more)
let mut delay = Duration::from_secs(10); // Wait 10 seconds before sending the first message to assure that peer will stay with us const MAX_SENT_PEERS: usize = 50;
// As per BEP 11 recommended interval is min 60 seconds
const PEX_MESSAGE_INTERVAL: Duration = Duration::from_secs(60);
// Wait 10 seconds before sending the first message to assure that peer will stay with us
let mut delay = Duration::from_secs(10);
loop { loop {
tokio::select! { tokio::select! {