halborn_ctf.network package

Subpackages

Module contents

halborn_ctf.network.find_free_port()[source]
halborn_ctf.network.wait_for_port(port: int, host: str = 'localhost', timeout: float = 5.0)[source]

Wait until a port starts accepting TCP connections.

Parameters:
  • port (int) – The port to wait for

  • host (str, optional) – The host where the port should be waited for. Defaults to ‘localhost’.

  • timeout (float, optional) – The amount in seconds to wait for before exiting. Defaults to 5.0.

Raises:

TimeoutError – The port isn’t accepting connection after time specified in timeout.