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.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'doc/zmq_recv.html') diff --git a/doc/zmq_recv.html b/doc/zmq_recv.html index 218892d..50aaa56 100644 --- a/doc/zmq_recv.html +++ b/doc/zmq_recv.html @@ -660,6 +660,14 @@ socket types that switch between several states, such as ZMQ_REP. See the The ØMQ context associated with the specified socket was terminated.

+
+EFAULT +
+
+

+The provided socket was not valid (NULL). +

+

EXAMPLE

@@ -673,13 +681,15 @@ int rc = zmq_msg_init (&msg); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_recv (socket, &msg, 0); -assert (rc == 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;
@@ -691,6 +701,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);
@@ -710,7 +721,8 @@ Martin Lucina <mato@kotelna.sk>.

<

-- cgit v1.2.3