summaryrefslogtreecommitdiff
path: root/src/zmq.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zmq.cpp')
-rw-r--r--src/zmq.cpp15
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;