diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-22 11:52:35 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-22 11:52:35 +0200 |
commit | e136d923b7060ef64d44264f88e49057e6638f31 (patch) | |
tree | 695c496b8a016eb04967a52279ef1a0958cf3a51 /src/zmq.cpp | |
parent | cc8136896d30890efb24aadc2d3058652aa43d45 (diff) |
ZMQ-specific error codes added
Diffstat (limited to 'src/zmq.cpp')
-rw-r--r-- | src/zmq.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/zmq.cpp b/src/zmq.cpp index e831046..d6f7023 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -19,6 +19,7 @@ #include "../bindings/c/zmq.h" +#include <string.h> #include <errno.h> #include <stdlib.h> #include <new> @@ -35,6 +36,20 @@ #include <sys/time.h> #endif +const char *zmq_strerror (int errnum_) +{ + switch (errnum_) { + case EMTHREAD: + return "Number of preallocated application threads exceeded"; + case EFSM: + return "Operation cannot be accomplished in current state"; + case ENOCOMPATPROTO: + return "The protocol is not compatible with the socket type"; + default: + return strerror (errnum_); + } +} + int zmq_msg_init (zmq_msg_t *msg_) { msg_->content = (zmq::msg_content_t*) ZMQ_VSM; |