summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpluth <39027073+pluth@users.noreply.github.com>2020-10-20 06:37:00 +0200
committerGitHub <noreply@github.com>2020-10-19 21:37:00 -0700
commitf73a2ad238f1b0ef193be5dbcafd6f2c6a99e098 (patch)
tree72332d1c98a364df53667eca09ed7d7a7ceb7c63
parentc793ead0c31b9c1a3ffd5858ca37e0e5a9d40d56 (diff)
docs: adjust TcpListener::from_std documentation to match behavior (#3002)
-rw-r--r--tokio/src/net/tcp/listener.rs20
1 files changed, 4 insertions, 16 deletions
diff --git a/tokio/src/net/tcp/listener.rs b/tokio/src/net/tcp/listener.rs
index d3323ae0..3f9bca03 100644
--- a/tokio/src/net/tcp/listener.rs
+++ b/tokio/src/net/tcp/listener.rs
@@ -198,28 +198,16 @@ impl TcpListener {
/// Creates a new TCP listener from the standard library's TCP listener.
///
- /// This method can be used when the `Handle::tcp_listen` method isn't
- /// sufficient because perhaps some more configuration is needed in terms of
- /// before the calls to `bind` and `listen`.
+ /// This function is intended to be used to wrap a TCP listener from the
+ /// standard library in the Tokio equivalent. The conversion assumes nothing
+ /// about the underlying listener; it is left up to the user to set it in
+ /// non-blocking mode.
///
/// This API is typically paired with the `net2` crate and the `TcpBuilder`
/// type to build up and customize a listener before it's shipped off to the
/// backing event loop. This allows configuration of options like
/// `SO_REUSEPORT`, binding to multiple addresses, etc.
///
- /// The `addr` argument here is one of the addresses that `listener` is
- /// bound to and the listener will only be guaranteed to accept connections
- /// of the same address type currently.
- ///
- /// The platform specific behavior of this function looks like:
- ///
- /// * On Unix, the socket is placed into nonblocking mode and connections
- /// can be accepted as normal
- ///
- /// * On Windows, the address is stored internally and all future accepts
- /// will only be for the same IP version as `addr` specified. That is, if
- /// `addr` is an IPv4 address then all sockets accepted will be IPv4 as
- /// well (same for IPv6).
///
/// # Examples
///