forked from mirror/async-std
always call shutdown
This commit is contained in:
parent
56769d8b6c
commit
1e99e3453f
2 changed files with 2 additions and 0 deletions
|
@ -343,6 +343,7 @@ impl Write for TcpStream {
|
|||
}
|
||||
|
||||
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
||||
self.shutdown(std::net::Shutdown::Write)?;
|
||||
Pin::new(&mut &*self).poll_close(cx)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,6 +192,7 @@ impl Write for UnixStream {
|
|||
}
|
||||
|
||||
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
||||
self.shutdown(std::net::Shutdown::Write)?;
|
||||
Pin::new(&mut &*self).poll_close(cx)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue