[zeromq-dev] Basic forwarder question
jhawk28 at gmail.com
Tue May 3 02:35:13 CEST 2011
Here is the full code... You should be connecting to the sender and then subscribing to all the messages.
context = zmq.Context(1)
incoming = context.socket(zmq.SUB)
outgoing = context.socket(zmq.PUB)
zmq.device(zmq.FORWARDER, incoming, outgoing)
receiver = context.socket(zmq.SUB)
On 5/2/2011 6:11 PM, Dan Gould wrote:
> I'm a ZeroMQ newbie, but couldn't find an answer to this via the docs or
> list archives (sorry if I missed it).
> I've been using a pub/sub connection. It works fine. I was using:
> receiver = context.socket(zmq.SUB)
> receiver.setsockopt(zmq.SUBSCRIBE, "")
> Now, I want an arbitrary number of publishers and an arbitrary number of
> subscribers. So, I run a forwarder:
> context = zmq.Context(1)
> publishers = context.socket(zmq.SUB) # Also tried flipping PUB and SUB
> subscribers = context.socket(zmq.PUB)
> zmq.device(zmq.FORWARDER, publishers, subscribers)
> and made my sender connect to 5555 instead of binding 5559 (and have my
> receiver connect to 5556).
> I don't get any messages. Is this how a forwarder should work?
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
More information about the zeromq-dev