Skip to content

Commit

Permalink
fix(s2n-quic-dc): set TCP_NODELAY on TCP sockets (#2398)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Dec 3, 2024
1 parent 9628008 commit a5fd516
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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

0 comments on commit a5fd516

Please sign in to comment.