From c90732a8058c0a68881a21093ce528901166d643 Mon Sep 17 00:00:00 2001 From: Toralf Wittner Date: Thu, 12 Dec 2019 17:37:38 +0100 Subject: [PATCH] TcpStream: Shutdown write direction in poll_close. Fixes #599. --- src/net/tcp/stream.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/tcp/stream.rs b/src/net/tcp/stream.rs index 4131783..ae8ca7d 100644 --- a/src/net/tcp/stream.rs +++ b/src/net/tcp/stream.rs @@ -356,6 +356,7 @@ impl Write for &TcpStream { } fn poll_close(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll> { + self.shutdown(std::net::Shutdown::Write)?; Poll::Ready(Ok(())) } }