Disable the Nagle algorithm

This commit is contained in:
Jan Trefil 2023-05-13 18:00:14 +02:00
parent cda0dd0ef7
commit 458b7bf0e8
2 changed files with 2 additions and 0 deletions

View file

@ -38,6 +38,7 @@ pub async fn run(
}; };
stream.set_linger(None).map_err(Error::Network)?; stream.set_linger(None).map_err(Error::Network)?;
stream.set_nodelay(false).map_err(Error::Network)?;
log::info!("Connected to server"); log::info!("Connected to server");

View file

@ -142,6 +142,7 @@ async fn client(
) -> Result<(), ClientError> { ) -> Result<(), ClientError> {
let negotiate = async { let negotiate = async {
stream.set_linger(None)?; stream.set_linger(None)?;
stream.set_nodelay(false)?;
let stream = acceptor.accept(stream).await?; let stream = acceptor.accept(stream).await?;
log::info!("{}: TLS connected", addr); log::info!("{}: TLS connected", addr);