Skip to content

Commit

Permalink
fix(transport): tcp nodelay option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Bostoen committed Jan 19, 2024
1 parent b5364c5 commit 6b2611f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion msg-transport/src/tcp/mod.rs
Original file line number Diff line number Diff line change
@@ -57,7 +57,12 @@ impl Transport for Tcp {
}

fn connect(&mut self, addr: SocketAddr) -> Self::Connect {
Box::pin(TcpStream::connect(addr))
Box::pin(async move {
let stream = TcpStream::connect(addr).await?;
stream.set_nodelay(true)?;

Ok(stream)
})
}

fn poll_accept(self: std::pin::Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Accept> {

0 comments on commit 6b2611f

Please sign in to comment.