[zeromq-dev] changing the C++ api to not throw exceptions on EFSM
Yi Ding
yi.s.ding at gmail.com
Thu Jan 26 23:25:21 CET 2012
On Thu, Jan 26, 2012 at 4:15 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> On 26/01/12 00:34, Yi Ding wrote:
>
> > Basically right now we have to call zmq_recv repeatedly until we get a
> > EAGAIN, otherwise the edge-triggered file descriptor won't reset. The
> > problem is that calling zmq_recv on a rep or req socket can also return
> > a EFSM, which will trigger an exception in the C++ interface, which we
> > then have to catch and handle.
>
> You can only get EFSM on REQ socket if you are trying to get a reply but
> haven't sent a request first. That looks more like an application error
> and deserves an at least an exception, but even an assert() could be
> appropriate.
>
> Martin
>
>
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?
Cheers,
Yi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120126/67c1ed74/attachment.htm>
More information about the zeromq-dev
mailing list