Modified test_app.py sshserver.py

This commit is contained in:
Sheng
2018-04-27 09:31:52 +08:00
parent 20be29f989
commit e88ecb2879
2 changed files with 9 additions and 6 deletions
+3 -3
View File
@@ -77,14 +77,14 @@ class Server (paramiko.ServerInterface):
return True
def run_ssh_server(app):
def run_ssh_server(running=True):
# now connect
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(('127.0.0.1', 2200))
sock.listen(100)
while not app._tear_down:
while running:
client, addr = sock.accept()
print('Got a connection!')
@@ -120,4 +120,4 @@ def run_ssh_server(app):
if __name__ == '__main__':
run_ssh_server(False)
run_ssh_server()