From c52fd0eebdc4cddee8ffa790bb49f90edab7a3eb Mon Sep 17 00:00:00 2001 From: Anastasios Kichidis Date: Wed, 20 Mar 2024 20:21:45 +0000 Subject: [PATCH] [refactor] set the congestion window settings --- crates/anemo/src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/anemo/src/config.rs b/crates/anemo/src/config.rs index 2d1ef12..2abc221 100644 --- a/crates/anemo/src/config.rs +++ b/crates/anemo/src/config.rs @@ -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)] @@ -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 } }