[zeromq-dev] Newbie Bait Request: Debug "Warning" mechanism.
zee at technocore.ru
Tue Aug 17 17:59:28 CEST 2010
On Tue, Aug 17, 2010 at 6:43 PM, Pieter Hintjens <ph at imatix.com> wrote:
> Not particularly, poll() would have to make the same assumption, but
> honestly I don't think treating the null case as "everything" is
> clean. It's a hack. Better to be 100% consistent.
Yes, of course. Having poll() make the same assumption would be even
worse, though. Consider the case you've described earlier (polling a
command socket and a subscription socket and applying commands as
SUBSCRIBE/UNSUBSCRIBE): if poll() on a socket with no subscriptions
assumes the socket is subscribed to everything, end users would have
to code extremely dirty logic in the command handler to avoid catching
all messages (create the sockets, but don't connect()/bind() the
subscribing one until the first subscription, close the socket and
recreate it instead of removing the last one, etc). Having recv() just
fail (and poll() to do nothing) would be a lot saner, IMO.
More information about the zeromq-dev