Skip to content

Commit

Permalink
feat: update congestion algorithm and set socket buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
metah3m committed Feb 14, 2025
1 parent a383146 commit 14ad718
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qconnection/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ impl Components {
let max_ack_delay = self.parameters.local()?.max_ack_delay().into_inner();

let cc = ArcCC::new(
CongestionAlgorithm::Bbr,
CongestionAlgorithm::NewReno,
Duration::from_micros(max_ack_delay as _),
[
self.spaces.initial().clone(),
Expand Down
1 change: 1 addition & 0 deletions qudp/src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl Io for UdpSocketController {

let addr = io.local_addr()?;
let is_ipv4 = addr.family() == libc::AF_INET as libc::sa_family_t;
self.setsockopt(libc::SOL_SOCKET, libc::SO_RCVBUF, 2 * 1024 * 1024);
if is_ipv4 || !io.only_v6()? {
// If enabled, the IP_TOS ancillary message is passed with
// incoming packets. It contains a byte which specifies the
Expand Down
1 change: 1 addition & 0 deletions qudp/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ impl Io for UdpSocketController {
let is_ipv6 = addr.is_ipv6();

let is_ipv4 = addr.is_ipv4();
self.setsockopt(WinSock::SOL_SOCKET, WinSock::SO_RCVBUF, 2 * 1024 * 1024);
if is_ipv4 {
self.setsockopt(WinSock::IPPROTO_IP, WinSock::IP_RECVTOS, OPTION_ON);
self.setsockopt(WinSock::IPPROTO_IP, WinSock::IP_PKTINFO, OPTION_ON);
Expand Down

0 comments on commit 14ad718

Please sign in to comment.