[zeromq-dev] zmq_socket_monitor Issue

Mark Studenka mstudenka at perseus.co
Tue Dec 8 15:48:13 CET 2015


Thanks.  I just wanted to make sure that at least my sample code looked
like I was doing the correct thing before assuming there may be a bug.

I'll see what I can find by digging into the libzmq code.

-mark

On Tue, Dec 8, 2015 at 8:02 AM, Pieter Hintjens <ph at imatix.com> wrote:

> The sample code looks ok, though I've not tried to run it. If you feel
> like it, digging into the libzmq code would be the best option.
>
> On Tue, Dec 8, 2015 at 6:27 AM, Mark Studenka <mstudenka at perseus.co>
> wrote:
> > I'm seeing some weirdness that I believe is related to a
> zmq_socket_monitor.
> > It seems that if I create a socket monitor and attach it to a REP socket
> and
> > then *also* join a multicast group with a SUB socket, I never receive any
> > callbacks on the socket monitor.
> >
> > Here's the basic gist of what I have and what I'm trying to do.  I have a
> > server with a REP socket and a PUB socket.  Clients connect a REQ to the
> REP
> > socket and send requests and such and also join a multicast on a SUB
> socket
> > connected to the server PUB.  I'm attempting to put a socket monitor on
> the
> > REQ socket to only send requests if the socket has been connected.
> >
> > The weird thing is that separately, all the code works.  The socket
> monitor
> > and REQ socket work just fine.  The SUB socket works just fine.  But when
> > it's all together, the SUB socket seems to block the socket monitor or
> REQ
> > socket from working properly.
> >
> > I've put some basic client code in a pastebin that re-creates the issue
> and
> > helps explain what I'm trying to do.  http://pastebin.com/tHa4eBxy  This
> > code can be run three ways:
> >
> > 1.  Just the REQ socket and socket monitor.  The socket connects and the
> > socket monitor reports the connection properly.
> > 2.  Just the SUB socket.  The socket joins the multicast and I receive
> > multicast traffic.
> > 3.  Both scenarios combined, the socket monitor never reports the REQ
> socket
> > as completing.  Using netstat I can see that the connection is
> established.
> >
> > I'm curious if someone can look at the example code I have and let me
> know
> > if there's something that looks wrong.  I've tried multiple variations to
> > make things work.  Everything I try it seems that the SUB socket is
> > interfering with the socket monitor or REQ socket in some way.  The
> posted
> > code is simply the most basic thing I've found that shows the issue I'm
> > having.
> >
> > Any help or tips would be appreciated.  If my sample code looks ok I'll
> > start digging down into the ZeroMQ code a little more to try to track
> down
> > what could be happening.
> >
> > Thanks.
> >
> > -mark
> >
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20151208/2923d3a7/attachment.htm>


More information about the zeromq-dev mailing list