예제 #1
0
class DDForwarder(multiprocessing.Process):
    def __init__(self, agentConfig, hostname, **options):
        multiprocessing.Process.__init__(self, name='ddforwarder')
        self.config = agentConfig
        self.is_enabled = True
        self.hostname = hostname
        self.options = options

    def run(self):
        from config import initialize_logging
        initialize_logging('windows_forwarder')
        log.debug("Windows Service - Starting forwarder")
        set_win32_cert_path()
        port = self.config.get('listen_port', 17124)
        if port is None:
            port = 17124
        else:
            port = int(port)
        app_config = get_config(parse_args=False)
        self.forwarder = Application(port, app_config, watchdog=False)
        try:
            self.forwarder.run()
        except Exception:
            log.exception("Uncaught exception in the forwarder")

    def stop(self):
        log.debug("Windows Service - Stopping forwarder")
        self.forwarder.stop()
예제 #2
0
 def run(self):
     from config import initialize_logging
     initialize_logging('windows_forwarder')
     log.debug("Windows Service - Starting forwarder")
     set_win32_cert_path()
     port = self.config.get('listen_port', 17124)
     if port is None:
         port = 17124
     else:
         port = int(port)
     app_config = get_config(parse_args=False)
     self.forwarder = Application(port, app_config, watchdog=False)
     try:
         self.forwarder.run()
     except Exception:
         log.exception("Uncaught exception in the forwarder")
예제 #3
0
 def fast_tornado(self):
     a = Application(12345, {"bind_host": "localhost"})
     a._watchdog = Watchdog(6)
     a._tr_manager = MockTxManager()
     a.run()
예제 #4
0
 def fast_tornado(self):
     a = Application(12345, self.AGENT_CONFIG)
     a._watchdog = Watchdog(6)
     a._tr_manager = MockTxManager()
     a.run()