[zeromq-dev] Are IronPython bindings for ZeroMQ available?

Brad Smith bnsmith at gmail.com
Mon Jan 17 21:36:50 CET 2011


One of the people that I work with played around with using the C#
bindings for ZeroMQ using IronPython. He modified one of the examples
to work in IronPython through the C# bindings. I'm including the code
here, just as a starting point for anyone else who wants to develop a
ZeroMQ application with IronPython.

import clr
clr.AddReference("clrzmq.dll")
clr.AddReference("System.dll")
from System.Text import Encoding
import ZMQ as zmq
from ZMQ import SocketType

context = zmq.Context(1)
socket = context.Socket(SocketType.REQ)

print "Connecting to hello world server..."
socket.Connect("tcp://localhost:5555")

for request in range(1,10):
    print "Sending request ", request,"..."
    socket.Send("Hello", Encoding.ASCII)

    message = socket.Recv(Encoding.ASCII)
    print "Received reply ", request, "[", message, "]"


Thanks to everyone who helped to create this great library!



More information about the zeromq-dev mailing list