Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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