reference/zmq/zmqsocket/recv.xml
d530899344cd881b6d09ff188e24252651c2f394
...
...
@@ -11,11 +11,11 @@
11
11
&reftitle.description;
12
12
<methodsynopsis>
13
13
<modifier>public</modifier> <type>string</type><methodname>ZMQSocket::recv</methodname>
14
-
<methodparam choice="opt"><type>integer</type><parameter>mode</parameter><initializer>0</initializer></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer>0</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Receive a message from a socket. By default receiving will block until a message is available unless
18
-
<constant>ZMQ::MODE_NOBLOCK</constant> flag is used. <constant>ZMQ::SOCKOPT_RCVMORE</constant>
18
+
<constant>ZMQ::MODE_DONTWAIT</constant> flag is used. <constant>ZMQ::SOCKOPT_RCVMORE</constant>
19
19
socket option can be used for receiving multi-part messages. See <function>ZMQSocket::setSockOpt</function>
20
20
for more information.
21
21
</para>
...
...
@@ -38,6 +38,21 @@
38
38
</para>
39
39
</refsect1>
40
40

41
+
<refsect1 role="returnvalues">
42
+
&reftitle.returnvalues;
43
+
<para>
44
+
Returns the message. If <constant>ZMQ::MODE_DONTWAIT</constant>
45
+
is used and the operation would block &false; shall be returned.
46
+
</para>
47
+
</refsect1>
48
+

49
+
<refsect1 role="errors">
50
+
&reftitle.errors;
51
+
<para>
52
+
Throws <classname>ZMQSocketException</classname> on error.
53
+
</para>
54
+
</refsect1>
55
+

41
56
<refsect1 role="examples">
42
57
&reftitle.examples;
43
58
<para>
...
...
@@ -64,10 +79,10 @@ do {
64
79
/* Try to send / receive */
65
80
if ($sending) {
66
81
echo "Sending message\n";
67
-
$queue->send("This is a message", ZMQ::MODE_NOBLOCK);
82
+
$queue->send("This is a message", ZMQ::MODE_DONTWAIT);
68
83
$sending = false;
69
84
} else {
70
-
echo "Got response: " . $queue->recv(ZMQ::MODE_NOBLOCK) . "\n";
85
+
echo "Got response: " . $queue->recv(ZMQ::MODE_DONTWAIT) . "\n";
71
86
break;
72
87
}
73
88
} catch (ZMQSocketException $e) {
...
...
@@ -96,16 +111,6 @@ Got response: This is a message
96
111
</para>
97
112
</refsect1>
98
113

99
-
<refsect1 role="returnvalues">
100
-
&reftitle.returnvalues;
101
-
<para>
102
-
Returns the message. Throws ZMQSocketException in error.
103
-
If <constant>ZMQ::MODE_NOBLOCK</constant> is used and the operation would
104
-
block &boolean; false shall be returned.
105
-
</para>
106
-
</refsect1>
107
-

108
-

109
114
</refentry>
110
115

111
116
<!-- Keep this comment at the end of the file
112
117