[zeromq-dev] exception from recv()

Ian Barber ian.barber at gmail.com
Wed Sep 26 21:22:12 CEST 2012


On Wed, Sep 26, 2012 at 5:46 PM, Tom Wilberding <tom at wilberding.com> wrote:
>> * Blocking calls now return EINTR if interrupted by the delivery of a
>>   signal; this also means that language bindings which previously had
>>   problems with handling SIGINT/^C should now work correctly.
>
> What is the best practice for handling this in C++? The zmq.hpp wrapper
> is throwing without any additional info when zmq_recv() returns -1 and
> errno is EINTR, so should my app be catching this exception? And if so,
> shouldn't information pertaining to the root cause of the interrupt be
> passed along?

It's throwing if it *isn't* EINTR - catch it and use errnum or what()
to see what the underlying issue is.

Ian



More information about the zeromq-dev mailing list