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

Function choose_service_port_for_bind

packages/server/src/main.rs:2429–2435  ·  view source on GitHub ↗
(preferred: u16, bind: IpAddr)

Source from the content-addressed store, hash-verified

2427}
2428
2429fn choose_service_port_for_bind(preferred: u16, bind: IpAddr) -> anyhow::Result<u16> {
2430 let port = preferred.max(1024);
2431 if port_available(bind, port) {
2432 return Ok(port);
2433 }
2434 anyhow::bail!("SimDeck service port {port} is already in use")
2435}
2436
2437fn choose_available_service_port_for_bind(preferred: u16, bind: IpAddr) -> anyhow::Result<u16> {
2438 let start = preferred.max(1024);

Callers 1

start_project_serviceFunction · 0.70

Calls 2

maxMethod · 0.80
port_availableFunction · 0.70

Tested by

no test coverage detected