diff --git a/include/zmq.h b/include/zmq.h index 322f2276..bd13e2e6 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -206,6 +206,9 @@ ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch); #define ZMQ_THREAD_PRIORITY 3 #define ZMQ_THREAD_SCHED_POLICY 4 #define ZMQ_MAX_MSGSZ 5 +// All options after this is for version 4.3 and still *draft* +// Subject to arbitrary change without notice +#define ZMQ_MSG_T_SIZE 6 /* Default for new contexts */ #define ZMQ_IO_THREADS_DFLT 1 diff --git a/src/ctx.cpp b/src/ctx.cpp index b2d70d56..8c6b24f5 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -301,6 +301,9 @@ int zmq::ctx_t::get (int option_) else if (option_ == ZMQ_MAX_MSGSZ) rc = max_msgsz; + else + if (option_ == ZMQ_MSG_T_SIZE) + rc = sizeof (zmq_msg_t); else { errno = EINVAL; rc = -1; diff --git a/tests/test_ctx_options.cpp b/tests/test_ctx_options.cpp index 482bef0c..9f6c159a 100644 --- a/tests/test_ctx_options.cpp +++ b/tests/test_ctx_options.cpp @@ -48,6 +48,7 @@ int main (void) #endif assert (zmq_ctx_get (ctx, ZMQ_IO_THREADS) == ZMQ_IO_THREADS_DFLT); assert (zmq_ctx_get (ctx, ZMQ_IPV6) == 0); + assert (zmq_ctx_get (ctx, ZMQ_MSG_T_SIZE) == sizeof (zmq_msg_t)); rc = zmq_ctx_set (ctx, ZMQ_IPV6, true); assert (zmq_ctx_get (ctx, ZMQ_IPV6) == 1);