Exemple #1
0
    def server_start_error(self, failure):
        controller.getInstance().log().log_error("Could not start multiplex server!")

        # Stop
        self.stop()

        failure.trap(CannotListenError)
Exemple #2
0
    def connectionLost(self, reason):
        controller.getInstance().log().log_debug("Closed connection to telnet Server...")
        self.connected = False

        # Notify Clients
        for client in self.clients:
            client.abortConnection()
Exemple #3
0
    def start(self):
        controller.getInstance().log().log_info("Starting multiplex server...")

        self.start_client()

        if not reactor.running:
            self.reactor_thread = ReactorThread()
            self.reactor_thread.start()
Exemple #4
0
    def client_start_error(self, failure):
        with self.lock:
            controller.getInstance().log().log_error("Could not connect to QEMU Monitor!")

            # Reset
            if self.client_delayed and self.client_delayed.active():
                self.client_delayed.cancel()

            self.client = None
            self.client_deferred = None
            self.client_delayed = None

            # Notify
            self.notify_waiting_threads()

            failure.trap(ConnectError, CancelledError)
Exemple #5
0
    def stop(self):
        with self.lock:
            controller.getInstance().log().log_info("Stopping multiplex server...")

            if self.client:
                self.client.abortConnection()

            if self.client_delayed and self.client_delayed.active():
                self.client_delayed.cancel()

            self.client = None
            self.client_deferred = None
            self.client_delayed = None

            if self.server:
                self.server.stopListening()

            self.server = None
            self.server_deferred = None

            self.notify_waiting_threads()
Exemple #6
0
 def connectionMade(self):
     controller.getInstance().log().log_debug("Established connection to telnet Server...")
     self.connected = True
Exemple #7
0
 def handleError(self, error):
     controller.getInstance().log().log_error(str(error))