Disable TCP linger

This commit is contained in:
Jan Trefil 2023-05-13 17:42:55 +02:00
parent 7cc34c7e26
commit 27187ccd73
2 changed files with 4 additions and 0 deletions

View file

@ -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

View file

@ -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);