コード例 #1
0
 def start_server(data):
     self.server = SSHServer()
     self.server.protocol = ServerProtocol
     self.port = reactor.listenTCP(self.portnum,
                                   self.server,
                                   interface=self.hostname)
     return self.port
コード例 #2
0
 def bring_up_server(data):
     self.server = SSHServer()
     self.server.protocol = ServerProtocol
     self.port = reactor.listenTCP(self.portnum,
                                   self.server,
                                   interface=self.hostname)
     log.debug('server started')
     return data.factory.dConnected
コード例 #3
0
ファイル: test_timeouts.py プロジェクト: cpopp/txsshclient
    def setUp(self):
        self.hostname = '127.0.0.1'
        self.user = getpass.getuser()
        self.password = '******'
        self.server = SSHServer()
        self.server.protocol = ServerProtocol

        self.port = reactor.listenTCP(0, self.server, interface=self.hostname)
        self.portnum = self.port.getHost().port

        options = {
            'hostname': self.hostname,
            'port': self.portnum,
            'user': self.user,
            'password': self.password,
            'buffersize': 32768
        }

        self.client = SSHClient(options)
        self.client.protocol = ClientProtocol
        self.client.connect()