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
81b9f21b
Commit
81b9f21b
authored
Jul 13, 2014
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1132 from rodgert/master
Added test and doc section for ZMQ_SHARED message flag
parents
d4d65da2
82282d69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
zmq_msg_get.txt
doc/zmq_msg_get.txt
+4
-0
test_msg_flags.cpp
tests/test_msg_flags.cpp
+20
-0
No files found.
doc/zmq_msg_get.txt
View file @
81b9f21b
...
...
@@ -29,6 +29,10 @@ allows application to retrieve the remote endpoint via 'getpeername(2)'. Be
aware that the respective socket might be closed already, reused even.
Currently only implemented for TCP sockets.
*ZMQ_SHARED*::
Indicates that a message has been copied and MAY share underlying storage
with another copy of this message.
RETURN VALUE
------------
The _zmq_msg_get()_ function shall return the value for the property if
...
...
tests/test_msg_flags.cpp
View file @
81b9f21b
...
...
@@ -65,6 +65,26 @@ int main (void)
more
=
zmq_msg_more
(
&
msg
);
assert
(
more
==
0
);
// Test ZMQ_SHARED property
zmq_msg_t
msg_a
;
rc
=
zmq_msg_init_size
(
&
msg_a
,
1024
);
// large enough to be a type_lmsg
assert
(
rc
==
0
);
// Message is not shared
rc
=
zmq_msg_get
(
&
msg_a
,
ZMQ_SHARED
);
assert
(
rc
==
0
);
zmq_msg_t
msg_b
;
rc
=
zmq_msg_init
(
&
msg_b
);
assert
(
rc
==
0
);
rc
=
zmq_msg_copy
(
&
msg_b
,
&
msg_a
);
assert
(
rc
==
0
);
// Message is now shared
rc
=
zmq_msg_get
(
&
msg_b
,
ZMQ_SHARED
);
assert
(
rc
==
1
);
// Deallocate the infrastructure.
rc
=
zmq_close
(
sc
);
assert
(
rc
==
0
);
...
...
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