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

Martin Sustrik sustrik at 250bpm.com
Thu Jan 26 23:15:03 CET 2012


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




More information about the zeromq-dev mailing list