summaryrefslogtreecommitdiff
path: root/doc/zmq_recv.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/zmq_recv.txt')
-rw-r--r--doc/zmq_recv.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/zmq_recv.txt b/doc/zmq_recv.txt
index 79d3dc1..dc60af6 100644
--- a/doc/zmq_recv.txt
+++ b/doc/zmq_recv.txt
@@ -63,6 +63,8 @@ socket types that switch between several states, such as ZMQ_REP. See the
_messaging patterns_ section of linkzmq:zmq_socket[3] for more information.
*ETERM*::
The 0MQ 'context' associated with the specified 'socket' was terminated.
+*EFAULT*::
+The provided 'socket' was not valid (NULL).
EXAMPLE
@@ -76,12 +78,14 @@ assert (rc == 0);
/* Block until a message is available to be received from socket */
rc = zmq_recv (socket, &msg, 0);
assert (rc == 0);
+/* Release message */
+zmq_msg_close (&msg);
----
.Receiving a multi-part message
----
int64_t more;
-int64_t more_size = sizeof more;
+size_t more_size = sizeof more;
do {
/* Create an empty 0MQ message to hold the message part */
zmq_msg_t part;
@@ -93,6 +97,7 @@ do {
/* Determine if more message parts are to follow */
rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size);
assert (rc == 0);
+ zmq_msg_close (&part);
} while (more);
----