[zeromq-dev] PUB/SUB with multiple publishers
david starkweather
starkdg at comcast.net
Sat Jul 17 15:12:42 CEST 2010
Yes, that's the code. I'll keep that in mind. Thanks. My queue seems
to work nicely with just one publisher thread. Not sure if there's an
advantage one way or another.
thanks again.
On Sat, 2010-07-17 at 09:46 +0200, Martin Sustrik wrote:
> Grant,
>
> > I recently tried something similar. My aim was to have a main publisher
> > socket in the main thread, and then each worker thread have a another
> > publisher socket. I would then have a pipe between the worker sockets
> > and a sub socket in the main thread. It is my understanding that the
> > forwarder device is supposed to work for this scenario - i.e. forward
> > from the sub skt to the main pub skt. I recieved no errors, but none of
> > the messages got delivered to the other sub skts that subscribed.
> >
> > I managed to implement my own queue in which I forward all messages, and
> > then have one publisher thread to just publish messages. I have only
> > been able to get the pub/sub mechanism to work when there is just one
> > publisher. If anyone has any alternate ideas, I'd be interested.
> > thanks.
>
> It is this code:
>
> http://pastebin.com/7wB68Hjy
>
> Right?
>
> If so, you are not subscribing to any messages in the worker socket
> (opened at line 101).
>
> Note that SUB socket subscribes for no messages by default.
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list