Skip to main content

bind_udp_with_device

Function bind_udp_with_device 

pub async fn bind_udp_with_device<N>(
    name: N,
) -> Result<UdpSocket, Box<dyn Error + Sync + Send>>
where N: TryInto<DeviceName> + Send + 'static, <N as TryInto<DeviceName>>::Error: Into<Box<dyn Error + Sync + Send>>,
Available on crate feature std and crate feature udp and (Android or Fuchsia or Linux) only.
Expand description

Creates a new UdpSocket, which will be bound to the specified (interface) device name).

This convenience helper currently creates an IPv4 UDP socket.

The returned socket is ready for accepting connections and connecting to others.