From 5ba1cb20fe6f6699cef1cc726718e760cd4c9af1 Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Mon, 23 Jan 2012 08:53:25 +0100 Subject: Imported Upstream version 2.0.9.dfsg --- doc/zmq_recv.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'doc/zmq_recv.txt') 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); ---- -- cgit v1.2.3