fn bind_socket(addr: SocketAddr) -> UdpSocket {
    let socket = UdpSocket::bind(&addr).expect("Failed to bind UDP socket");
    socket.set_broadcast(true).expect("set_broadcast call failed");
    if addr.is_ipv6() {
        socket.set_multicast_loop_v6(true).expect("set_multicast_loop_v6 call failed");
    }
    socket
}
/// Bind a UDP listener to the socket address.
Bind a UDP listener to the socket address.
Bind a UDP listener to the socket address .
fn bind_socket(addr: SocketAddr) -> UdpSocket {
    let socket = UdpSocket::bind(&addr).expect("Failed to bind UDP socket");
    socket.set_broadcast(true).expect("set_broadcast call failed");
    if addr.is_ipv6() {
        socket.set_multicast_loop_v6(true).expect("set_multicast_loop_v6 call failed");
    }
    socket
}
fn bind_socket ( addr : SocketAddr ) -> UdpSocket { let socket = UdpSocket :: bind ( & addr ) . expect ( " " ) ; socket . set_broadcast ( true ) . expect ( " " ) ; if addr . is_ipv6 ( ) { socket . set_multicast_loop_v6 ( true ) . expect ( " " ) ; } socket }
Bind a UDP listener to the socket address.
Bind a UDP listener to the socket address .
addr
SocketAddr
addr
SocketAddr