MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / port_available

Function port_available

packages/server/src/main.rs:2447–2452  ·  view source on GitHub ↗
(bind: IpAddr, port: u16)

Source from the content-addressed store, hash-verified

2445}
2446
2447fn port_available(bind: IpAddr, port: u16) -> bool {
2448 if bind.is_unspecified() && TcpListener::bind((Ipv4Addr::LOCALHOST, port)).is_err() {
2449 return false;
2450 }
2451 TcpListener::bind((bind, port)).is_ok()
2452}
2453
2454fn open_browser(url: &str) -> anyhow::Result<()> {
2455 ProcessCommand::new("open")

Calls

no outgoing calls

Tested by

no test coverage detected