Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
185fed39
Commit
185fed39
authored
Nov 20, 2016
by
Constantin Rack
Committed by
GitHub
Nov 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2220 from bluca/zmq_msg_size
Problem: size of zmq_msg_t is not known to FFI wrappers
parents
3db69212
8a286bb8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
0 deletions
+17
-0
NEWS
NEWS
+3
-0
zmq_ctx_get.txt
doc/zmq_ctx_get.txt
+7
-0
zmq.h
include/zmq.h
+3
-0
ctx.cpp
src/ctx.cpp
+3
-0
test_ctx_options.cpp
tests/test_ctx_options.cpp
+1
-0
No files found.
NEWS
View file @
185fed39
0MQ version 4.2.1 stable, released on 201x/xx/xx
=============================================
* New Context options:
- ZMQ_MSG_T_SIZE
0MQ version 4.2.0 stable, released on 2016/11/04
=============================================
...
...
doc/zmq_ctx_get.txt
View file @
185fed39
...
...
@@ -57,6 +57,13 @@ zero if the "block forever on context termination" gambit was disabled by
setting ZMQ_BLOCKY to false on all new contexts.
ZMQ_MSG_T_SIZE: Get the zmq_msg_t size at runtime
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_MSG_T_SIZE' argument returns the size of the zmq_msg_t structure at
runtime, as defined in the include/zmq.h public header.
This is useful for example for FFI bindings that can't simply do a sizeof().
RETURN VALUE
------------
The _zmq_ctx_get()_ function returns a value of 0 or greater if successful.
...
...
include/zmq.h
View file @
185fed39
...
...
@@ -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
...
...
src/ctx.cpp
View file @
185fed39
...
...
@@ -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
;
...
...
tests/test_ctx_options.cpp
View file @
185fed39
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment