Function sui_config::local_ip_utils::get_available_port

source ·
pub fn get_available_port(host: &str) -> u16
Expand description

Return an ephemeral, available port. On unix systems, the port returned will be in the TIME_WAIT state ensuring that the OS won’t hand out this port for some grace period. Callers should be able to bind to this port given they use SO_REUSEADDR.