[zeromq-dev] Can zmq_pollitem_t contain an item with a NULL socket ?
Goswin von Brederlow
goswin-v-b at web.de
Sat Feb 1 13:18:17 CET 2014
On Thu, Jan 30, 2014 at 10:56:04AM +0100, Laurent Alebarde wrote:
> In fact, it is in src/zmq.cpp / "int zmq_poll (zmq_pollitem_t
> *items_, int nitems_, long timeout_)"
>
> When the socket is NULL, zmq_poll takes the second attribute of the
> zmq_pollitem_t structure which is a file descriptor. So, I cannot do
> anything here, as "socket == NULL and fd == 0" is legitimate.
That is because 0 is a valid FD. What about "socket == NULL" and "fd
== -1"?
> Conclusion: I have to deal myself with the complexity of not having
> NULL sockets in my zmq_pollitem_t array.
>
> Le 30/01/2014 09:23, Laurent Alebarde a écrit :
> >Thanks Pieter.
> >
> >Personnaly, I would prefer "ignore", in order to build
> >zmq_pollitem_t arrays with more ease, when they are built by the
> >application itself, and not hardwritten in the code.
> >
> >Any objection ?
> >
> >Le 29/01/2014 20:20, Pieter Hintjens a écrit :
> >>Undefined, by the man page. It should probably assert in such a case.
> >>
> >>On Wed, Jan 29, 2014 at 12:07 PM, Laurent Alebarde<l.alebarde at free.fr> wrote:
> >>>Hi Devs,
> >>>
> >>>What is the zmq_poll behaviour when the zmq_pollitem_t array contains an
> >>>item with a NULL socket ? ignored, undefined, error ?
> >>>
> >>>If it is in src/poll.cpp / "void zmq::poll_t::loop ()" / "for
> >>>(pollset_t::size_type i = 0; i != pollset.size (); i++)", it seems there is
> >>>no NULL test with a continue.
> >>>
> >>>Cheers,
> >>>
> >>>
> >>>Laurent
MfG
Goswin
More information about the zeromq-dev
mailing list