Skip to main content

udp_bind

Function udp_bind 

Source
pub fn udp_bind(addr: SocketAddr) -> Result<UdpSocket, ServerBindError>
Expand description

Bind a non-blocking UDP listener socket on addr.

Mirrors server_bind but for DGRAM: SO_REUSEADDR (unix) + SO_REUSEPORT so the socket can be SCM-passed and re-bound across a hot-upgrade, then bind + non-blocking. Unlike TCP there is no listen() — a UDP socket receives datagrams directly. The returned mio::net::UdpSocket is the one listener socket the UDP datapath demuxes many flows over (one-socket-many- flows; per-flow return sockets are created by udp_connect).