// binds many sockets to the same port in a range
binds many sockets to the same port in a range
binds many sockets to the same port in a range
pub fn multi_bind_in_range(range: PortRange, mut num: usize) -> io::Result<(u16, Vec<UdpSocket>)> {
    if cfg!(windows) && num != 1 {
        // See https://github.com/solana-labs/solana/issues/4607
        warn!(
            "multi_bind_in_range() only supports 1 socket in windows ({} requested)",
            num
        );
        num = 1;
    }
    let mut sockets = Vec::with_capacity(num);
    let port = {
        let (port, _) = bind_in_range(range)?;
        port
    }; // drop the probe, port should be available... briefly.
    for _ in 0..num {
        sockets.push(bind_to(port, true)?);
    }
    Ok((port, sockets))
}
pub fn multi_bind_in_range ( range : PortRange , mut num : usize ) -> io :: Result < ( u16 , Vec < UdpSocket > ) > { if cfg ! ( windows ) && num != 1 { // See https://github.com/solana-labs/solana/issues/4607 warn ! ( " " num ) ; num = 1 ; } let mut sockets = Vec :: with_capacity ( num ) ; let port = { let ( port , _ ) = bind_in_range ( range ) ? ; port } ; // drop the probe, port should be available... briefly. for _ in 0 .. num { sockets . push ( bind_to ( port , true ) ? ) ; } Ok ( ( port , sockets ) ) }
binds many sockets to the same port in a range
binds many sockets to the same port in a range
range
PortRange
num
usize