Exemplo n.º 1
0
 def receiveError(self, reasonCode, description):
     """
     Called when we receive a disconnect error message from the other
     side.
     """
     error = disconnectErrors.get(reasonCode, DisconnectError)
     self.connectionClosed(error(reasonCode, description))
     SSHClientTransport.receiveError(self, reasonCode, description)
Exemplo n.º 2
0
 def receiveError(self, reasonCode, description):
     """
     Called when we receive a disconnect error message from the other
     side.
     """
     error = disconnectErrors.get(reasonCode, DisconnectError)
     self.connectionClosed(error(reasonCode, description))
     SSHClientTransport.receiveError(self, reasonCode, description)
Exemplo n.º 3
0
    def test_cleanupConnectionImmediately(self):
        """
        L{_NewConnectionHelper.cleanupConnection} closes the transport with
        C{abortConnection} if called with C{immediate} set to C{True}.
        """
        class Abortable:
            aborted = False

            def abortConnection(self):
                """
                Abort the connection.
                """
                self.aborted = True

        helper = _NewConnectionHelper(None, None, None, None, None, None, None,
                                      None, None, None)
        connection = SSHConnection()
        connection.transport = SSHClientTransport()
        connection.transport.transport = Abortable()
        helper.cleanupConnection(connection, True)
        self.assertTrue(connection.transport.transport.aborted)
Exemplo n.º 4
0
 def connectionLost(self, reason):
     SSHClientTransport.connectionLost(self, reason)
     self.connectionClosed(reason)
Exemplo n.º 5
0
 def connectionLost(self, reason):
     SSHClientTransport.connectionLost(self, reason)
     self.connectionClosed(reason)