[zeromq-dev] Newbie Bait Request: Debug "Warning" mechanism.
Matt Weinstein
matt_weinstein at yahoo.com
Tue Aug 17 14:08:09 CEST 2010
Not obvious, but there could be, I outlined two cases earlier.
Without some fancy mind-reading by ØMQ I'm not sure how you could
distinguish those cases from a development error.
It's fairly easy to understand when nothing comes out, and fix it.
You might want to offer a wrapper or two for subs sockets, like:
zmq_subscribe_all(sock, endpoint);
zmq_subscribe_one(sock, endpoint, const char* pattern);
That also does the initial setsockopt...
On Aug 17, 2010, at 6:24 AM, Pieter Hintjens wrote:
> On Tue, Aug 17, 2010 at 6:45 AM, Oliver Smith <oliver at kfs.org> wrote:
>
>> Might it be a good idea to introduce a warnings system into the
>> ZeroMQ debug-build flavor.
>>
>> debugWarn(ZMQ_WARNING_33) ; // ZeroMQ Caution #33: Application
>> called recv() on a ZMQ_SUB socket without subscribing to any
>> topics. (See zmq_setsockopt).
>
> This is certainly an error everyone hits and it's so flagrant that it
> feels like a design issue. There is no validity in doing a blocking
> recv on a SUB socket that has no subscriptions.
>
> I'd like to see 0MQ assert if an app tries to do this. Does anyone
> find this unreasonable?
>
> If the requirement is to wait for term() there are surely more
> explicit ways than abusing SUB sockets.
>
> -
> Pieter Hintjens
> iMatix - www.imatix.com
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list