aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-15 02:26:10 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-15 02:26:10 -0400
commit0b3542344af0d5723ba386c0cdfccd9a11eff6d6 (patch)
tree95eb716c1cff3bdd4e2e4d56c963099f71f2975e
parent28d067c6d814d8aa53c8b8541d0cedb630409197 (diff)
downloadpython-termcast-server-0b3542344af0d5723ba386c0cdfccd9a11eff6d6.tar.gz
python-termcast-server-0b3542344af0d5723ba386c0cdfccd9a11eff6d6.zip
also notify on disconnects
-rw-r--r--ssh.py1
-rw-r--r--termcast.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/ssh.py b/ssh.py
index 0758d49..e191438 100644
--- a/ssh.py
+++ b/ssh.py
@@ -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 {