[zeromq-dev] Using ZMQ_FD with select
Schmurfy
schmurfy at gmail.com
Sun Feb 19 14:29:41 CET 2012
But the descriptor returned by ZMQ_FD is not the "real" descriptor right ?
>From my understanding it is just a way to use zeromq sockets with an
external event loop and in general it works quite well.
On 19 February 2012 14:06, john skaller <skaller at users.sourceforge.net>wrote:
>
> On 19/02/2012, at 9:02 PM, Schmurfy wrote:
>
> > Now I really feel stupid xD
> >
> > Thanks for pointing this out, not really intuitive.
> > I am back to square one since it does not explain my problem then xD
> >
> > But I am curious what was your problem with REQ/REP if not this one
> because I also have problems with REQ/REP where the other sockets type
> works as intended.
> > I just can't pinpoint what exactly is wrong and where.
>
> Somehow my message didn't get posted.
>
> What actually happens is that ZMQ is doing a select itself,
> and it loads the message in a background thread so fast that
> by the time YOU do the select, there's nothing to read on the fd.
>
> ZMQ has already read it.
>
> You must use zmq_poll. You cannot use select yourself on a fd
> owned by ZMQ, that leads to a race:)
>
> --
> john skaller
> skaller at users.sourceforge.net
>
>
>
>
> _______________________________________________
> 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/20120219/4d42c579/attachment.htm>
More information about the zeromq-dev
mailing list