From e4a236578bcb36109d238753307c970d6c997666 Mon Sep 17 00:00:00 2001 From: Cameron Bytheway Date: Mon, 9 Dec 2024 09:49:42 -0700 Subject: [PATCH] feat(s2n-quic-dc): set linger to 0 (#2407) --- dc/s2n-quic-dc/src/stream/client/tokio.rs | 1 + dc/s2n-quic-dc/src/stream/server/tokio/tcp.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/dc/s2n-quic-dc/src/stream/client/tokio.rs b/dc/s2n-quic-dc/src/stream/client/tokio.rs index cd9a736b4..ceb345594 100644 --- a/dc/s2n-quic-dc/src/stream/client/tokio.rs +++ b/dc/s2n-quic-dc/src/stream/client/tokio.rs @@ -64,6 +64,7 @@ where // Make sure TCP_NODELAY is set let _ = socket.set_nodelay(true); + let _ = socket.set_linger(Some(core::time::Duration::ZERO)); // if the acceptor_ip isn't known, then ask the socket to resolve it for us let peer_addr = if acceptor_addr.ip().is_unspecified() { diff --git a/dc/s2n-quic-dc/src/stream/server/tokio/tcp.rs b/dc/s2n-quic-dc/src/stream/server/tokio/tcp.rs index b4dd603e0..86740dbc1 100644 --- a/dc/s2n-quic-dc/src/stream/server/tokio/tcp.rs +++ b/dc/s2n-quic-dc/src/stream/server/tokio/tcp.rs @@ -502,6 +502,7 @@ where { // Make sure TCP_NODELAY is set let _ = stream.set_nodelay(true); + let _ = stream.set_linger(Some(Duration::ZERO)); let meta = event::api::ConnectionMeta { id: 0, // TODO use an actual connection ID