[zeromq-dev] [jzmq] xreq/xrep sockets and thread safety

Martin Sustrik sustrik at moloch.sk
Fri Aug 13 23:50:31 CEST 2010

Hi Matt,

On 08/12/2010 09:42 PM, Matt Weinstein wrote:
> There's an ongoing discussion about this.  A hard failure may be 
> difficult for some environments, you're correct.
> A thought --
> I'm beginning to think that error options should be a ØMQ compile time 
> option, e.g. replace all of the asserts with e.g.:
> if (rc)
> return zmq_error(int errno, const char* what);
> Then zmq_error(...) can abort or return an errno depending on the 
> compile time (or dynamic?) implementation of zmq_error.
> If there are places where something can't happen, you can call 
> zmq_abort(...) with the same args.

That can't be done as errors occur asynchronously.

However, the framing errors shouldn't crash the system.

The right solution IMO is to have an internal inproc "error" publisher 
node that you can subscribe to to get error:

s = socket (ZMQ_SUB);
s.connect ("inproc://error");
err = s.recv ();


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100813/631dbbc8/attachment.htm>

More information about the zeromq-dev mailing list