diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2023-02-06 17:13:08 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-02-06 17:13:08 +0000 |
commit | 28aa86009a5eab4ba6d63844d34c5b4b41038203 (patch) | |
tree | d585fc992b047e0d1fb217f44c39d241d2c81c72 /src/net/udp.rs | |
parent | 6d9e152041be899074b952a8f0d1d5b1c73d2a05 (diff) | |
parent | 65647f91f23b1650e6783e09c178803ec888efb4 (diff) | |
download | tokio-28aa86009a5eab4ba6d63844d34c5b4b41038203.tar.gz |
Upgrade tokio to 1.25.0 am: a77df93fec am: 65647f91f2
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tokio/+/2421506
Change-Id: I67638423614c339172fce0fa096cb3faf41af23c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'src/net/udp.rs')
-rw-r--r-- | src/net/udp.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/net/udp.rs b/src/net/udp.rs index af343f2..213d914 100644 --- a/src/net/udp.rs +++ b/src/net/udp.rs @@ -179,14 +179,21 @@ impl UdpSocket { /// Creates new `UdpSocket` from a previously bound `std::net::UdpSocket`. /// /// This function is intended to be used to wrap a UDP socket from the - /// standard library in the Tokio equivalent. The conversion assumes nothing - /// about the underlying socket; it is left up to the user to set it in - /// non-blocking mode. + /// standard library in the Tokio equivalent. /// /// This can be used in conjunction with socket2's `Socket` interface to /// configure a socket before it's handed off, such as setting options like /// `reuse_address` or binding to multiple addresses. /// + /// # Notes + /// + /// The caller is responsible for ensuring that the socket is in + /// non-blocking mode. Otherwise all I/O operations on the socket + /// will block the thread, which will cause unexpected behavior. + /// Non-blocking mode can be set using [`set_nonblocking`]. + /// + /// [`set_nonblocking`]: std::net::UdpSocket::set_nonblocking + /// /// # Panics /// /// This function panics if thread-local runtime is not set. |