summaryrefslogtreecommitdiffstats
path: root/tokio/src/net/tcp/stream.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2020-07-12 19:25:58 -0700
committerGitHub <noreply@github.com>2020-07-12 19:25:58 -0700
commit98e78314794607d0b402d5e45c66e3b8e38b819c (patch)
treebbfd7d0d84cdd4fc58fe7adbdf5758b1c4aaf8e6 /tokio/src/net/tcp/stream.rs
parent8411a6945f2d4711a9422dfd4d3362e08b6e8f99 (diff)
net: fix OwnedWriteHalf behavior on drop (#2597)
Previously, dropping the Write handle would issue a `shutdown(Both)`. However, shutting down the read half is not portable and not the correct action to take. This changes the behavior of OwnedWriteHalf to only perform a `shutdown(Write)` on drop.
Diffstat (limited to 'tokio/src/net/tcp/stream.rs')
-rw-r--r--tokio/src/net/tcp/stream.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tokio/src/net/tcp/stream.rs b/tokio/src/net/tcp/stream.rs
index 92c7c84e..319ef72e 100644
--- a/tokio/src/net/tcp/stream.rs
+++ b/tokio/src/net/tcp/stream.rs
@@ -652,7 +652,8 @@ impl TcpStream {
/// Unlike [`split`], the owned halves can be moved to separate tasks, however
/// this comes at the cost of a heap allocation.
///
- /// **Note:** Dropping the write half will close the TCP stream in both directions.
+ /// **Note::** Dropping the write half will shutdown the write half of the TCP
+ /// stream. This is equivalent to calling `shutdown(Write)` on the `TcpStream`.
///
/// [`split`]: TcpStream::split()
pub fn into_split(self) -> (OwnedReadHalf, OwnedWriteHalf) {