mirror of
https://github.com/async-rs/async-std.git
synced 2025-03-31 13:36:41 +00:00
Merge pull request #603 from bluk/udp-socket-recv-doc
Change recv_from to recv in UdpSocket::recv doc
This commit is contained in:
commit
bce8688763
1 changed files with 3 additions and 2 deletions
|
@ -298,10 +298,11 @@ impl UdpSocket {
|
||||||
/// use async_std::net::UdpSocket;
|
/// use async_std::net::UdpSocket;
|
||||||
///
|
///
|
||||||
/// let socket = UdpSocket::bind("127.0.0.1:0").await?;
|
/// let socket = UdpSocket::bind("127.0.0.1:0").await?;
|
||||||
|
/// socket.connect("127.0.0.1:8080").await?;
|
||||||
///
|
///
|
||||||
/// let mut buf = vec![0; 1024];
|
/// let mut buf = vec![0; 1024];
|
||||||
/// let (n, peer) = socket.recv_from(&mut buf).await?;
|
/// let n = socket.recv(&mut buf).await?;
|
||||||
/// println!("Received {} bytes from {}", n, peer);
|
/// println!("Received {} bytes", n);
|
||||||
/// #
|
/// #
|
||||||
/// # Ok(()) }) }
|
/// # Ok(()) }) }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Reference in a new issue