reference/sockets/functions/socket-recv.xml
14dc7c47365f2b71f6c907a5ba5bccf42534d5a9
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.socket-recv">
3
+
<refentry xml:id="function.socket-recv" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>socket_recv</refname>
6
6
<refpurpose>Receives data from a connected socket </refpurpose>
...
...
@@ -9,25 +9,25 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>int</type><methodname>socket_recv</methodname>
13
-
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter role="reference">buf</parameter></methodparam>
15
-
<methodparam><type>int</type><parameter>len</parameter></methodparam>
12
+
<type class="union"><type>int</type><type>false</type></type><methodname>socket_recv</methodname>
13
+
<methodparam><type>Socket</type><parameter>socket</parameter></methodparam>
14
+
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter role="reference">data</parameter></methodparam>
15
+
<methodparam><type>int</type><parameter>length</parameter></methodparam>
16
16
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
The <function>socket_recv</function> function receives
20
-
<parameter>len</parameter> bytes of data in <parameter>buf</parameter> from
20
+
<parameter>length</parameter> bytes of data in <parameter>data</parameter> from
21
21
<parameter>socket</parameter>. <function>socket_recv</function> can
22
22
be used to gather data from connected sockets. Additionally, one or
23
23
more flags can be specified to modify the behaviour of the
24
24
function.
25
25
</para>
26
26
<para>
27
-
<parameter>buf</parameter> is passed by reference, so it must be
27
+
<parameter>data</parameter> is passed by reference, so it must be
28
28
specified as a variable in the argument list. Data read from
29
29
<parameter>socket</parameter> by <function>socket_recv</function>
30
-
will be returned in <parameter>buf</parameter>.
30
+
will be returned in <parameter>data</parameter>.
31
31
</para>
32
32
</refsect1>
33
33

...
...
@@ -39,29 +39,29 @@
39
39
<term><parameter>socket</parameter></term>
40
40
<listitem>
41
41
<para>
42
-
The <parameter>socket</parameter> must be a socket resource previously
42
+
The <parameter>socket</parameter> must be a <classname>Socket</classname> instance previously
43
43
created by socket_create().
44
44
</para>
45
45
</listitem>
46
46
</varlistentry>
47
47

48
48
<varlistentry>
49
-
<term><parameter>buf</parameter></term>
49
+
<term><parameter>data</parameter></term>
50
50
<listitem>
51
51
<para>
52
52
The data received will be fetched to the variable specified with
53
-
<parameter>buf</parameter>. If an error occurs, if the
53
+
<parameter>data</parameter>. If an error occurs, if the
54
54
connection is reset, or if no data is
55
-
available, <parameter>buf</parameter> will be set to &null;.
55
+
available, <parameter>data</parameter> will be set to &null;.
56
56
</para>
57
57
</listitem>
58
58
</varlistentry>
59
59

60
60
<varlistentry>
61
-
<term><parameter>len</parameter></term>
61
+
<term><parameter>length</parameter></term>
62
62
<listitem>
63
63
<para>
64
-
Up to <parameter>len</parameter> bytes will be fetched from remote host.
64
+
Up to <parameter>length</parameter> bytes will be fetched from remote host.
65
65
</para>
66
66
</listitem>
67
67
</varlistentry>
...
...
@@ -101,7 +101,7 @@
101
101
<row>
102
102
<entry><constant>MSG_WAITALL</constant></entry>
103
103
<entry>
104
-
Block until at least <parameter>len</parameter> are received.
104
+
Block until at least <parameter>length</parameter> are received.
105
105
However, if a signal is caught or the remote host disconnects, the
106
106
function may return less data.
107
107
</entry>
...
...
@@ -133,6 +133,23 @@
133
133
</para>
134
134
</refsect1>
135
135

136
+
<refsect1 role="changelog">
137
+
&reftitle.changelog;
138
+
<informaltable>
139
+
<tgroup cols="2">
140
+
<thead>
141
+
<row>
142
+
<entry>&Version;</entry>
143
+
<entry>&Description;</entry>
144
+
</row>
145
+
</thead>
146
+
<tbody>
147
+
&sockets.changelog.socket-param;
148
+
</tbody>
149
+
</tgroup>
150
+
</informaltable>
151
+
</refsect1>
152
+

136
153
<refsect1 role="examples">
137
154
&reftitle.examples;
138
155
<para>
...
...
@@ -140,7 +157,7 @@
140
157
<title><function>socket_recv</function> example</title>
141
158
<para>
142
159
This example is a simple rewrite of the first example from
143
-
<xref linkend="sockets.examples" /> to
160
+
<xref linkend="sockets.examples"/> to
144
161
use <function>socket_recv</function>.
145
162
</para>
146
163
<programlisting role="php">
...
...
@@ -224,7 +241,6 @@ OK.
224
241
</refsect1>
225
242
226
243
</refentry>
227
-

228
244
<!-- Keep this comment at the end of the file
229
245
Local variables:
230
246
mode: sgml
231
247