How to use the portend.client_host function in portend

To help you get started, we’ve selected a few portend examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cherrypy / cherrypy / cherrypy / process / servers.py View on Github external
@contextlib.contextmanager
def _safe_wait(host, port):
    """
    On systems where a loopback interface is not available and the
    server is bound to all interfaces, it's difficult to determine
    whether the server is in fact occupying the port. In this case,
    just issue a warning and move on. See issue #1100.
    """
    try:
        yield
    except portend.Timeout:
        if host == portend.client_host(host):
            raise
        msg = 'Unable to verify that the server is bound on %r' % port
        warnings.warn(msg)
github Southpaw-TACTIC / TACTIC / 3rd_party / python2 / site-packages / cherrypy / process / servers.py View on Github external
def _safe_wait(host, port):
    """
    On systems where a loopback interface is not available and the
    server is bound to all interfaces, it's difficult to determine
    whether the server is in fact occupying the port. In this case,
    just issue a warning and move on. See issue #1100.
    """
    try:
        yield
    except portend.Timeout:
        if host == portend.client_host(host):
            raise
        msg = 'Unable to verify that the server is bound on %r' % port
        warnings.warn(msg)

portend

TCP port monitoring and discovery

MIT
Latest version published 11 months ago

Package Health Score

66 / 100
Full package analysis