From 27187ccd73e24b1139b5319b4050c75070d370b4 Mon Sep 17 00:00:00 2001 From: Jan Trefil <8711792+htrefil@users.noreply.github.com> Date: Sat, 13 May 2023 17:42:55 +0200 Subject: [PATCH] Disable TCP linger --- rkvm-client/src/client.rs | 2 ++ rkvm-server/src/server.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/rkvm-client/src/client.rs b/rkvm-client/src/client.rs index 8e2db3f..d7d3838 100644 --- a/rkvm-client/src/client.rs +++ b/rkvm-client/src/client.rs @@ -37,6 +37,8 @@ pub async fn run( _ => unimplemented!("Unhandled rustls ServerName variant: {:?}", hostname), }; + stream.set_linger(None).map_err(Error::Network)?; + log::info!("Connected to server"); let stream = connector diff --git a/rkvm-server/src/server.rs b/rkvm-server/src/server.rs index b6fc0c0..977bbe1 100644 --- a/rkvm-server/src/server.rs +++ b/rkvm-server/src/server.rs @@ -141,6 +141,8 @@ async fn client( password: &str, ) -> Result<(), ClientError> { let negotiate = async { + stream.set_linger(None)?; + let stream = acceptor.accept(stream).await?; log::info!("{}: TLS connected", addr);