Skip to content

Commit

Permalink
Merge pull request #618 from twittner/poll_close_shutdown
Browse files Browse the repository at this point in the history
TcpStream: Shutdown write direction in poll_close.
  • Loading branch information
yoshuawuyts committed Dec 13, 2019
2 parents 3d3bf91 + c90732a commit 96d6fc4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ impl Write for &TcpStream {
}

fn poll_close(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<io::Result<()>> {
self.shutdown(std::net::Shutdown::Write)?;
Poll::Ready(Ok(()))
}
}
Expand Down

0 comments on commit 96d6fc4

Please sign in to comment.