add: publishers.setsockopt(zmq.SUBSCRIBE, "") Joshua On 5/2/2011 6:11 PM, Dan Gould wrote: > Hi, > > 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: > > Sender: > sender.bind("tcp://127.0.0.1:5559") > ... > sender.send_json(message) > > Receiver: > receiver = context.socket(zmq.SUB) > receiver.connect("tcp://127.0.0.1:5559") > 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 > publishers.bind("tcp://127.0.0.1:5555"); > subscribers = context.socket(zmq.PUB) > subscribers.bind('tcp://127.0.0.1:5556') > > 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? > > Thanks. > _______________________________________________ > zeromq-dev mailing list > zeromq-dev@lists.zeromq.org > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev