[zeromq-dev] [Fwd: Re: socket call back when using the zmq_loop]

Jon Dyte jon at totient.co.uk
Sat Dec 19 20:24:11 CET 2009


On Saturday 19 Dec 2009, Petitdemange Sébastien wrote:

> > if you have control of the publishing topic space on the ZMQ_PUB
> > side you could add the source indicator to the topic, say s1 and s2,
> >
> > then Martin's example would become (caveat, completely untested)
> >
> >  zmq::socket_t s (ctx, ZMQ_SUB);
> > s.connect ("tcp://server001:5555");
> > s.connect ("tcp://server002:5555");
> > s.setsockopt (ZMQ_SUBSCRIBE, "S1abc.*", 5); // from server 1
> > s.setsockopt (ZMQ_SUBSCRIBE, "S2def.*", 5); // from server 2

just noticed a typo, those args should be 7, not 5
i did say it was untested ;-)


> > while (true)
> > {
> >
> > .....
> >
> >
> > Jon
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> >   
> Thanks a lot Jon, I didn't know that 1 soket could do multiple 
> filtering... Sorring for that.
> 
no problem,

> SEB
> 





More information about the zeromq-dev mailing list