The C++ API is currently written in such a way that any return value on
zmq_recv, except for EAGAIN, triggers an exception.

However, if we use REQ/REP in conjunction with ZMQ_FD, as we currently do
in our code and nzmqt (I'm sure it's also used in other bindings) EFSM is
basically unavoidable as triggering a EFSM is required if we want to
"reset" the receive state for the edge-triggering.

There are a couple of ways I can think of dealing with this (from least to
most radical):
1) try catches every time we call recv.  This is how we do this currently,
but having exceptions that aren't exceptional doesn't seem to be
particularly good programming practice.
2) don't throw an exception on EFSM in the C++ binding, and instead return
false
3) if ZMQ_NOBLOCK is passed in, replace EFSM with EAGAIN.
4) Get rid of REQ-REP entirely, and just subsume it with ROUTER-DEALER

Cheers,
Yi
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to