mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-29 00:32:34 +08:00
commit
fcd9b9506a
@ -16,7 +16,7 @@ DESCRIPTION
|
||||
-----------
|
||||
The _zmq_msg_copy()_ function shall copy the message object referenced by 'src'
|
||||
to the message object referenced by 'dest'. The original content of 'dest', if
|
||||
any, shall be released.
|
||||
any, shall be released. You must initialize 'dest' before copying to it.
|
||||
|
||||
CAUTION: The implementation may choose not to physically copy the message
|
||||
content, rather to share the underlying buffer between 'src' and 'dest'. Avoid
|
||||
@ -41,6 +41,21 @@ ERRORS
|
||||
Invalid message.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
-------
|
||||
.Copying a message
|
||||
----
|
||||
zmq_msg_t msg;
|
||||
zmq_msg_init_size (&msg, 255);
|
||||
memcpy (zmq_msg_data (&msg, "Hello, World", 12);
|
||||
zmq_msg_t copy;
|
||||
zmq_msg_init (©);
|
||||
zmq_msg_copy (©, &msg);
|
||||
...
|
||||
zmq_msg_close (©);
|
||||
zmq_msg_close (&msg);
|
||||
----
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
linkzmq:zmq_msg_move[3]
|
||||
|
@ -90,7 +90,7 @@ zmq_msg_close (&msg);
|
||||
|
||||
.Receiving a multi-part message
|
||||
----
|
||||
int64_t more;
|
||||
int more;
|
||||
size_t more_size = sizeof (more);
|
||||
do {
|
||||
/* Create an empty 0MQ message to hold the message part */
|
||||
|
@ -88,7 +88,7 @@ zmq_msg_close (&msg);
|
||||
|
||||
.Receiving a multi-part message
|
||||
----
|
||||
int64_t more;
|
||||
int more;
|
||||
size_t more_size = sizeof (more);
|
||||
do {
|
||||
/* Create an empty 0MQ message to hold the message part */
|
||||
|
Loading…
x
Reference in New Issue
Block a user