From 5dd3d58974c97b6f13789f776439db2c98a6ba9f Mon Sep 17 00:00:00 2001 From: Jonas Bostoen Date: Fri, 19 Jan 2024 16:48:42 +0100 Subject: [PATCH] fix(transport): tcp nodelay option on publisher --- msg-transport/src/tcp/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/msg-transport/src/tcp/mod.rs b/msg-transport/src/tcp/mod.rs index c9c9058..fd16b11 100644 --- a/msg-transport/src/tcp/mod.rs +++ b/msg-transport/src/tcp/mod.rs @@ -76,7 +76,10 @@ impl Transport for Tcp { Poll::Ready(Ok((io, addr))) => { tracing::debug!("Accepted connection from {}", addr); - Poll::Ready(Box::pin(async move { Ok(io) })) + Poll::Ready(Box::pin(async move { + io.set_nodelay(true)?; + Ok(io) + })) } Poll::Ready(Err(e)) => Poll::Ready(async_error(e)), Poll::Pending => Poll::Pending,