Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(s2n-quic-dc): set TCP_NODELAY on TCP sockets #2398

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dc/s2n-quic-dc/src/stream/client/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ where
// Race TCP handshake with the TLS handshake
let (socket, peer) = tokio::try_join!(TcpStream::connect(acceptor_addr), handshake,)?;

// Make sure TCP_NODELAY is set
let _ = socket.set_nodelay(true);

let stream = endpoint::open_stream(env, peer, env::TcpRegistered(socket), subscriber, None)?;

// build the stream inside the application context
Expand Down
3 changes: 3 additions & 0 deletions dc/s2n-quic-dc/src/stream/server/tokio/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ where
) where
Pub: EndpointPublisher,
{
// Make sure TCP_NODELAY is set
let _ = stream.set_nodelay(true);

let meta = event::api::ConnectionMeta {
id: 0, // TODO use an actual connection ID
timestamp: now.into_event(),
Expand Down
Loading