Commit b9f8d553 authored by Luke Macken's avatar Luke Macken

Merge pull request #20 from ryazwinski/develop

handle failed reverse connections gracefully
parents c6a3ac53 4b5e9293
......@@ -70,13 +70,18 @@ class ReverseConnection(threading.Thread, PyrasiteIPC):
continue
break
if not self.sock:
raise Exception('pyrasite cannot establish reverse connection to %s:%d' % (self.host, self.port))
self.on_connect()
while running:
cmd = self.recv()
if cmd is None or cmd == "quit\n" or len(cmd) == 0:
running = False
else:
running = self.on_command(cmd)
except Exception as e:
print(str(e))
running = False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment