[telepathy-salut/master] xmppstream: add setup_stream_listener6

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Apr 1 08:29:47 PDT 2009


---
 tests/twisted/xmppstream.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/xmppstream.py b/tests/twisted/xmppstream.py
index 572af6f..5c987bc 100644
--- a/tests/twisted/xmppstream.py
+++ b/tests/twisted/xmppstream.py
@@ -11,6 +11,8 @@ from twisted.words.xish import domish, xpath, xmlstream
 from twisted.internet.protocol import Factory, ClientFactory
 from twisted.internet import reactor
 
+from ipv6 import listenTCP6
+
 NS_STREAMS = 'http://etherx.jabber.org/streams'
 
 def make_stream_event(type, stanza):
@@ -138,6 +140,16 @@ def setup_stream_listener(queue, name, port = 0, protocol = None):
 
     return (factory, port.getHost().port)
 
+def setup_stream_listener6(queue, name, port = 0, protocol = None):
+    if protocol == None:
+        protocol = IncomingXmppStream
+
+    factory = IncomingXmppFactory()
+    factory.protocol = lambda *args: protocol(queue.append, name)
+    port = listenTCP6(port, factory)
+
+    return (factory, port.getHost().port)
+
 class OutgoingXmppStream(BaseXmlStream):
     def __init__(self, event_function, name, remote_name):
         BaseXmlStream.__init__(self, event_function, name, remote_name)
-- 
1.5.6.5




More information about the telepathy-commits mailing list