[telepathy-python/master] stream_tube_client: connect ConnectionClosed

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Jun 12 03:41:07 PDT 2009


---
 examples/stream_tube_client.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/examples/stream_tube_client.py b/examples/stream_tube_client.py
index b6b5eec..51cb01f 100644
--- a/examples/stream_tube_client.py
+++ b/examples/stream_tube_client.py
@@ -122,6 +122,9 @@ class StreamTubeClient:
                 self.tube[CHANNEL_TYPE_STREAM_TUBE].connect_to_signal(
                        "NewLocalConnection",
                        self.stream_tube_new_local_connection_cb)
+                self.tube[CHANNEL_TYPE_STREAM_TUBE].connect_to_signal(
+                       "ConnectionClosed",
+                       self.stream_tube_connection_closed_cb)
 
                 self.got_tube(props)
 
@@ -163,6 +166,9 @@ class StreamTubeClient:
     def stream_tube_new_local_connection_cb(self, conn_id):
        print "new socket connection on tube (id: %u)" % conn_id
 
+    def stream_tube_connection_closed_cb(self, conn_id, error, msg):
+        print "socket connection %r has been closed: %s (%s)" % (conn_id, msg, error)
+
 class StreamTubeInitiatorClient(StreamTubeClient):
     def __init__(self, account_file, muc_id, contact_id, socket_address=None):
         StreamTubeClient.__init__(self, account_file, muc_id, contact_id)
-- 
1.5.6.5




More information about the telepathy-commits mailing list