[zeromq-dev] changing the C++ api to not throw exceptions on EFSM

Martin Sustrik sustrik at 250bpm.com
Fri Jan 27 01:13:38 CET 2012


On 01/27/2012 07:25 AM, Yi Ding wrote:

> This could very well be my fault, but everything people have said on the
> mailing list is that to "reset" the edge-trigger, we must repeatedly
> call receive until we get a EAGAIN.   However, in certain cases, after
> receiving a message, and calling receive again, instead of a EAGAIN, we
> get EFSM.  What's the correct behavior here then?

How it should work IMO, is something like this:

send (s, msg);
poll (s);
recv (s, msg) => EAGAIN
poll (s);
recv (s, msg) => OK
send (s, msg);
poll (s);
recv (s, msg) => EAGAIN
poll (s);
recv (s, msg) => OK

etc.

Note that EFSM never happens.

Martin



More information about the zeromq-dev mailing list