diff options
Diffstat (limited to 'doc/zmq_recv.3')
-rw-r--r-- | doc/zmq_recv.3 | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/doc/zmq_recv.3 b/doc/zmq_recv.3 index 8e9720e..1c65e4d 100644 --- a/doc/zmq_recv.3 +++ b/doc/zmq_recv.3 @@ -2,12 +2,12 @@ .\" Title: zmq_recv .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/> -.\" Date: 06/04/2010 +.\" Date: 09/06/2010 .\" Manual: 0MQ Manual -.\" Source: 0MQ 2.0.7 +.\" Source: 0MQ 2.0.9 .\" Language: English .\" -.TH "ZMQ_RECV" "3" "06/04/2010" "0MQ 2\&.0\&.7" "0MQ Manual" +.TH "ZMQ_RECV" "3" "09/06/2010" "0MQ 2\&.0\&.9" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -88,6 +88,13 @@ associated with the specified \fIsocket\fR was terminated\&. .RE +.PP +\fBEFAULT\fR +.RS 4 +The provided +\fIsocket\fR +was not valid (NULL)\&. +.RE .SH "EXAMPLE" .PP \fBReceiving a message from a socket\fR. @@ -103,6 +110,8 @@ 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); .fi .if n \{\ .RE @@ -115,7 +124,7 @@ assert (rc == 0); .\} .nf 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; @@ -127,6 +136,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); .fi .if n \{\ |