The socket_t::send function examples returns a bool to indicate if the message was sent successfully but I have never seen any sample code that checks this return value.
According to the 0MQ C++ API C errors are converted to exceptions:
All errors reported by the underlying ØMQ C library functions are automatically converted to exceptions by the C++ language binding. The zmq::error_t class is derived from the std::exception class and uses the zmq_strerror() function to convert the error code to human-readable string.
Is it necessary to check the return value of send? Is there any case where the the send function would return false but not throw an exception?
From the source code:
So the answer is there – send will return false if zmq_send sets the error to EAGAIN. To understand when that could happen, read the documentation for zmq_socket and zmq_setsockopt.
You should check the return value if the socket you are using might raise EAGAIN, and you want to handle this condition. You can handle it, for example, by queuing the message and trying again later.