# when connected => generate watchdog object to monitor the # server connection logging.info("[%s] Starting watchdog thread." % fileName) watchdog = ConnectionWatchdog(globalData.serverComm, globalData.pingInterval, globalData.smtpAlert) # set thread to daemon # => threads terminates when main thread terminates watchdog.daemon = True watchdog.start() # initialize all alerts logging.info("[%s] Initializing alerts." % fileName) for alert in globalData.alerts: alert.initializeAlert() # only start update checker if it is activated if updateActivated is True: logging.info("[%s] Starting update check thread." % fileName) updateChecker = UpdateChecker(updateServer, updatePort, updateLocation, updateCaFile, updateInterval, updateEmailNotification, globalData) # set thread to daemon # => threads terminates when main thread terminates updateChecker.daemon = True updateChecker.start() logging.info("[%s] Client started." % fileName) # generate receiver to handle incoming data (for example status updates) receiver = Receiver(globalData.serverComm) receiver.run()
logging.critical("[%s]: Connecting to server failed. " % fileName + "Try again in 5 seconds.") time.sleep(5) # when connected => generate watchdog object to monitor the # server connection watchdog = ConnectionWatchdog(globalData.serverComm, globalData.pingInterval, globalData.smtpAlert) # set thread to daemon # => threads terminates when main thread terminates watchdog.daemon = True watchdog.start() # initialize all alerts for alert in globalData.alerts: alert.initializeAlert() # only start update checker if it is activated if updateActivated is True: updateChecker = UpdateChecker(updateServer, updatePort, updateLocation, updateCaFile, updateInterval, updateEmailNotification, globalData) # set thread to daemon # => threads terminates when main thread terminates updateChecker.daemon = True updateChecker.start() # generate receiver to handle incoming data (for example status updates) receiver = Receiver(globalData.serverComm) receiver.run()