Skip to content

Commit

Permalink
[refactor] set the congestion window settings
Browse files Browse the repository at this point in the history
  • Loading branch information
akichidis committed Mar 20, 2024
1 parent 26d415e commit c52fd0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/anemo/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use quinn::VarInt;
use rcgen::{CertificateParams, KeyPair, SignatureAlgorithm};
use serde::{Deserialize, Serialize};
use std::{sync::Arc, time::Duration};
use quinn_proto::congestion;

/// Configuration for a [`Network`](crate::Network).
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
Expand Down Expand Up @@ -342,6 +343,11 @@ impl QuicConfig {
config.keep_alive_interval(Some(keep_alive_interval));
}

let mut cc_config = congestion::NewRenoConfig::default();
cc_config.loss_reduction_factor(0.7);
cc_config.initial_window(4 << 20);
config.congestion_controller_factory(Arc::new(cc_config));

config
}
}
Expand Down

0 comments on commit c52fd0e

Please sign in to comment.