Enable BBR. (#22)

This commit is contained in:
kixelated 2023-06-08 10:08:18 -07:00 committed by GitHub
parent c88f0b045a
commit f0dafdf784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -61,10 +61,14 @@ impl Server {
tls_config.alpn_protocols = alpn; tls_config.alpn_protocols = alpn;
let mut server_config = quinn::ServerConfig::with_crypto(sync::Arc::new(tls_config)); let mut server_config = quinn::ServerConfig::with_crypto(sync::Arc::new(tls_config));
// Enable BBR congestion control
// TODO validate the implementation
let mut transport_config = quinn::TransportConfig::default(); let mut transport_config = quinn::TransportConfig::default();
transport_config.keep_alive_interval(Some(time::Duration::from_secs(2))); transport_config.keep_alive_interval(Some(time::Duration::from_secs(2)));
server_config.transport = sync::Arc::new(transport_config); transport_config.congestion_controller_factory(sync::Arc::new(quinn::congestion::BbrConfig::default()));
server_config.transport = sync::Arc::new(transport_config);
let server = quinn::Endpoint::server(server_config, config.addr)?; let server = quinn::Endpoint::server(server_config, config.addr)?;
let broadcast = config.broadcast; let broadcast = config.broadcast;