summaryrefslogtreecommitdiff
path: root/python/server
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2007-01-16 05:28:25 +0000
committerRafael H. Schloming <rhs@apache.org>2007-01-16 05:28:25 +0000
commit8021505b531ba4c022ab89f8a2bd59bf8af3c1fc (patch)
tree7165613b0996b55b466e140accdf6f81bae33b4c /python/server
parentd24ea0b5a3f4ca7c1a7f30f9af99b4e7338a1d85 (diff)
downloadqpid-python-8021505b531ba4c022ab89f8a2bd59bf8af3c1fc.tar.gz
0-9 request/response framing for python
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@496593 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/server')
-rwxr-xr-xpython/server30
1 files changed, 30 insertions, 0 deletions
diff --git a/python/server b/python/server
new file mode 100755
index 0000000000..4204bc8515
--- /dev/null
+++ b/python/server
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+from qpid import spec
+from qpid.connection import Connection, listen
+from qpid.delegate import Delegate
+from qpid.peer import Peer
+
+class Server(Delegate):
+
+ def connection_open(self, ch, msg):
+ msg.open_ok()
+
+ def channel_open(self, ch, msg):
+ print "channel %s open" % ch.id
+ msg.open_ok()
+
+ def message_transfer(self, ch, msg):
+ print msg.body
+ msg.ok()
+
+
+spec = spec.load("../specs/amqp.0-9.xml")
+
+for io in listen("0.0.0.0", 5672):
+ c = Connection(io, spec)
+ p = Peer(c, Server())
+ c.tini()
+ p.start()
+ ch = p.channel(0)
+ ch.connection_start()
+ ch.connection_tune()