Matt Weinstein wrote: > On Jul 13, 2010, at 8:22 AM, Martin Sustrik wrote: > >> Hi Matt, >> >>> It looks like I'm going to have to write (branch) a "no throw" >>> version >>> of the C++ wrappers for our blended (C/C++) environment. >>> >>> I hate maintaining alternative forks, but IMO it's better to expect a >>> return value consistently, and the "value of destruction" is too >>> great. >>> >>> I presume I'll get rights to submit it. Will anyone else find it >>> useful? >> Why not use raw C API then? The C++ API does basically nothing aside >> of >> converting POSIX error codes into C++ exceptions. > > Primarily to prevent the introduction of leaks, forgotten closes, > etc. I'm handing zmq::message_t s into naive userland. > > I was thinking about writing a private wrapper, but figure a > contribution would be useful.
I would make it an alternative C++ binding. When you have it ready we can link it from C++ bindings wiki page: "For those who prefer not to deal with C++ exceptions..." etc. >>> Any preference on returning bool vs. int for status? Why? >> Because EAGAIN as returned by zmq_send and zmq_recv is not a real >> error >> that should be turned into exception, rather it is success status >> saying >> "everything is OK, but the action cannot be accomplished immediately, >> try again later". >> > That's fair, I'll return a positive error number, or 0 for success? I would mimic the C error handling. The less different ways of reporting errors the better. Martin _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
