[zeromq-dev] Newbie Bait Request: Debug "Warning" mechanism.

Pieter Hintjens ph at imatix.com
Tue Aug 17 15:26:57 CEST 2010

On Tue, Aug 17, 2010 at 3:14 PM, Matt Weinstein
<matt_weinstein at yahoo.com> wrote:

> You're right, and I can't find it.
> Basically, you could be waiting for ETERM, but I forget the other case.

I think it was a subscriber that dynamically adds/remove filters and
at some point ends up with no filters.  But that's a broken use case
because if code ever ends in that state it won't exit the recv().

Martin also mentioned waiting for ETERM but it seems nasty to use a
SUB socket for that and especially to allow this trap to exist simply
to support that use case.

My suggestion: if code calls zmq_recv() without NOBLOCK on a SUB
socket with no filters, 0MQ asserts.

As a secondary suggestion, the null/block case turns into "subscribe
to EVERYTHING" which is what 100% of people want when they naively
write code and omit the filter.

Yesterday I spent 30 minutes wondering why my subscriber wasn't
working.  Facepalm... but it just should not require additional effort
to make the simplest possible case work.

Pieter Hintjens
iMatix - www.imatix.com

More information about the zeromq-dev mailing list