diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-09-15 02:26:10 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-09-15 02:26:10 -0400 |
commit | 0b3542344af0d5723ba386c0cdfccd9a11eff6d6 (patch) | |
tree | 95eb716c1cff3bdd4e2e4d56c963099f71f2975e | |
parent | 28d067c6d814d8aa53c8b8541d0cedb630409197 (diff) | |
download | python-termcast-server-0b3542344af0d5723ba386c0cdfccd9a11eff6d6.tar.gz python-termcast-server-0b3542344af0d5723ba386c0cdfccd9a11eff6d6.zip |
also notify on disconnects
-rw-r--r-- | ssh.py | 1 | ||||
-rw-r--r-- | termcast.py | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -37,6 +37,7 @@ class Connection(object): while True: c = self.chan.recv(1) if c == b'q': + self.publisher.notify("viewer_disconnect", self.watching_id) break self.chan.close() diff --git a/termcast.py b/termcast.py index e849fe8..40262e0 100644 --- a/termcast.py +++ b/termcast.py @@ -81,7 +81,10 @@ class Connection(object): if connection_id != self.connection_id: return self.publisher.notify("new_data", self.connection_id, self.handler.buf, b'') - self.client.send("msg watcher connected") + self.client.send(b"msg watcher connected\n") + + def msg_viewer_disconnect(self, connection_id): + self.client.send(b"msg watcher disconnected\n") def request_get_streamers(self): return { |