akkudoktoreos.server.server.wait_for_port_free
- akkudoktoreos.server.server.wait_for_port_free(port: int, timeout: int = 0, waiting_app_name: str = 'App') bool
Wait for a network port to become free, with timeout.
Checks if the port is currently in use and logs warnings with process details. Retries every 3 seconds until timeout is reached.
- Parameters:
port – The network port number to check
timeout – Maximum seconds to wait (0 means check once without waiting)
waiting_app_name – Name of the application waiting for the port
- Returns:
True if port is free, False if port is still in use after timeout
- Return type:
bool
- Raises:
ValueError – If port number or timeout is invalid
psutil.Error – If there are problems accessing process information