util.network

Module Contents

util.network.wait_for_tcp(host, port, *, timeout=600, to_shutdown=False, compare=None)

Wait for a TCP server to start responding on a given ‘host’ and ‘port’.

Optionally, read len(compare) bytes from the socket and compare them to the bytestring specified in ‘compare’. If they are different, close the socket and (re)try again later. Useful for waiting for b’SSH-’ to start answering on port 22.