fn run_udp_receiver(config: Config, sync: Arc<(Mutex<Vec<Vec<u8>>>, Condvar)>) -> Result<(), Error> {
    let mut ioloop = try!(Core::new());
    let handle = ioloop.handle();

    let builder = try!(UdpBuilder::new_v4());

    match builder.reuse_address(true) {
        Ok(_) => debug!("enabled SO_REUSEADDR"),
        Err(e) => warn!("failed to enable SO_REUSEADDR: {}", e.description()),
    }

    match builder.reuse_port(true) {
        Ok(_) => debug!("enabled SO_REUSEPORT"),
        Err(e) => warn!("failed to enable SO_REUSEPORT: {}", e.description()),
    }

    let socket = try!(builder.bind(&config.addr));
    let evented_socket = try!(UdpSocket::from_socket(socket, &handle));

    let receiver = UDPReceiver {
        socket: evented_socket,
        buf: vec![0; config.mtu as usize],
        incoming: None,
        sync: sync,
    };

    try!(ioloop.run(receiver));
    Ok(())
}
/// Starts an evented UDP message listener
/// It is assumed that the port being listened to is re-used
Starts an evented UDP message listener
It is assumed that the port being listened to is re-used
Starts an evented UDP message listener It is assumed that the port being listened to is re - used
fn run_udp_receiver(config: Config, sync: Arc<(Mutex<Vec<Vec<u8>>>, Condvar)>) -> Result<(), Error> {
    let mut ioloop = try!(Core::new());
    let handle = ioloop.handle();
    let builder = try!(UdpBuilder::new_v4());
    match builder.reuse_address(true) {
        Ok(_) => debug!("enabled SO_REUSEADDR"),
        Err(e) => warn!("failed to enable SO_REUSEADDR: {}", e.description()),
    }
    match builder.reuse_port(true) {
        Ok(_) => debug!("enabled SO_REUSEPORT"),
        Err(e) => warn!("failed to enable SO_REUSEPORT: {}", e.description()),
    }
    let socket = try!(builder.bind(&config.addr));
    let evented_socket = try!(UdpSocket::from_socket(socket, &handle));
    let receiver = UDPReceiver {
        socket: evented_socket,
        buf: vec![0; config.mtu as usize],
        incoming: None,
        sync: sync,
    };
    try!(ioloop.run(receiver));
    Ok(())
}
fn run_udp_receiver ( config : Config , sync : Arc < ( Mutex < Vec < Vec < u8 > > > , Condvar ) > ) -> Result < ( ) , Error > { let mut ioloop = try ! ( Core new ( ) ) ; let handle = ioloop . handle ( ) ; let builder = try ! ( UdpBuilder new_v4 ( ) ) ; match builder . reuse_address ( true ) { Ok ( _ ) => debug ! ( " " ) , Err ( e ) => warn ! ( " " e description ( ) ) , } match builder . reuse_port ( true ) { Ok ( _ ) => debug ! ( " " ) , Err ( e ) => warn ! ( " " e description ( ) ) , } let socket = try ! ( builder bind ( config addr ) ) ; let evented_socket = try ! ( UdpSocket from_socket ( socket handle ) ) ; let receiver = UDPReceiver { socket : evented_socket , buf : vec ! [ 0 config mtu as usize ] , incoming : None , sync : sync , } ; try ! ( ioloop run ( receiver ) ) ; Ok ( ( ) ) }
Starts an evented UDP message listener
It is assumed that the port being listened to is re-used
Starts an evented UDP message listener It is assumed that the port being listened to is re - used
config
Config
sync
Arc<(Mutex<Vec<Vec<u8>>>, Condvar)>
config
Config
sync
Arc<(Mutex<Vec<Vec<u8>>>, Condvar)>