def checkServer(self): """ Attempt to call the server, and try to re-connect on error. The server could be restarted, or there could have been a network issue between the time we originally connected to the server and now, which would invalidate the original server connection. """ try: self.server.getInfo() except: self.server = ScanServerConnector.connect()
def __init__(self): # Connection to the scan server self.server = ScanServerConnector.connect() # Scan ID self.id = -1