mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-08 06:42:57 +01:00
Problem: size of zmq_msg_t is not known to FFI wrappers
Solution: add a ZMQ_MSG_T_SIZE context read-only option so that wrappers can call zmq_ctx_get (ctx, ZMQ_MSG_T_SIZE) to get the size at runtime.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user