|
|
|
@ -117,9 +117,10 @@ impl UdpSocket {
|
|
|
|
|
/// # #![feature(async_await)]
|
|
|
|
|
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
|
|
|
|
/// #
|
|
|
|
|
/// use async_std::net::UdpSocket;
|
|
|
|
|
/// use std::net::IpAddr;
|
|
|
|
|
///
|
|
|
|
|
/// use async_std::net::UdpSocket;
|
|
|
|
|
///
|
|
|
|
|
/// let socket = UdpSocket::bind("127.0.0.1:0").await?;
|
|
|
|
|
/// let addr = socket.local_addr()?;
|
|
|
|
|
/// #
|
|
|
|
@ -446,9 +447,10 @@ impl UdpSocket {
|
|
|
|
|
/// # #![feature(async_await)]
|
|
|
|
|
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
|
|
|
|
/// #
|
|
|
|
|
/// use async_std::net::UdpSocket;
|
|
|
|
|
/// use std::net::Ipv4Addr;
|
|
|
|
|
///
|
|
|
|
|
/// use async_std::net::UdpSocket;
|
|
|
|
|
///
|
|
|
|
|
/// let interface = Ipv4Addr::new(0, 0, 0, 0);
|
|
|
|
|
/// let mdns_addr = Ipv4Addr::new(224, 0, 0, 123);
|
|
|
|
|
///
|
|
|
|
@ -475,9 +477,10 @@ impl UdpSocket {
|
|
|
|
|
/// # #![feature(async_await)]
|
|
|
|
|
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
|
|
|
|
/// #
|
|
|
|
|
/// use async_std::net::UdpSocket;
|
|
|
|
|
/// use std::net::{Ipv6Addr, SocketAddr};
|
|
|
|
|
///
|
|
|
|
|
/// use async_std::net::UdpSocket;
|
|
|
|
|
///
|
|
|
|
|
/// let socket_addr = SocketAddr::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0).into(), 0);
|
|
|
|
|
/// let mdns_addr = Ipv6Addr::new(0xFF02, 0, 0, 0, 0, 0, 0, 0x0123) ;
|
|
|
|
|
/// let socket = UdpSocket::bind(&socket_addr).await?;
|
|
|
|
|