How to use the poap.tcpserve.SocketWorker.__init__ function in POAP

To help you get started, we’ve selected a few POAP 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 dbindel / POAP / poap / tcpserve.py View on Github external
def __init__(self, sockname, retries=0):
        """Initialize the ProcessSocketWorker.

        The constructor tries to open the socket; on failure, it keeps
        trying up to retries times, once per second.

        Args:
            sockname: (host, port) tuple where server lives
            retries: number of times to retry the connection
        """
        SocketWorker.__init__(self, sockname, retries)
        self.process = None
github dbindel / POAP / poap / tcpserve.py View on Github external
def __init__(self, objective, sockname, retries=0):
        """Initialize the SimpleSocketWorker.

        The constructor tries to open the socket; on failure, it keeps
        trying up to retries times, once per second.

        Args:
            objective: Python objective function
            sockname: (host, port) tuple where server lives
            retries: number of times to retry the connection
        """
        SocketWorker.__init__(self, sockname, retries)
        self.objective = objective