Skip to main content

is_port_available

Function is_port_available 

Source
pub async fn is_port_available(port: u16) -> bool
Expand description

Check if a port is available.

NOTE: This has a TOCTOU race – the port may be taken between the check and actual use. Prefer bind_available_port when you need to guarantee the port stays reserved.