reference/sockets/functions/socket-read.xml
f80105b4fc1196bd8d5fecb98d686b580b1ff65d
...
...
@@ -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-read">
3
+
<refentry xml:id="function.socket-read" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>socket_read</refname>
6
6
<refpurpose>Reads a maximum of length bytes from a socket</refpurpose>
...
...
@@ -9,14 +9,14 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>string</type><methodname>socket_read</methodname>
13
-
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>socket_read</methodname>
13
+
<methodparam><type>Socket</type><parameter>socket</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>length</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>type</parameter><initializer>PHP_BINARY_READ</initializer></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>PHP_BINARY_READ</constant></initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
-
The function <function>socket_read</function> reads from the socket
19
-
resource <parameter>socket</parameter> created by the
18
+
The function <function>socket_read</function> reads from the <classname>Socket</classname> instance
19
+
<parameter>socket</parameter> created by the
20
20
<function>socket_create</function> or
21
21
<function>socket_accept</function> functions.
22
22
</para>
...
...
@@ -30,7 +30,7 @@
30
30
<term><parameter>socket</parameter></term>
31
31
<listitem>
32
32
<para>
33
-
A valid socket resource created with <function>socket_create</function>
33
+
A <classname>Socket</classname> instance created with <function>socket_create</function>
34
34
or <function>socket_accept</function>.
35
35
</para>
36
36
</listitem>
...
...
@@ -41,17 +41,17 @@
41
41
<para>
42
42
The maximum number of bytes read is specified by the
43
43
<parameter>length</parameter> parameter. Otherwise you can use
44
-
<constant>&#92;r</constant>, <constant>&#92;n</constant>,
45
-
or <constant>&#92;0</constant> to end reading (depending on the <parameter>type</parameter>
44
+
<literal>\r</literal>, <literal>\n</literal>,
45
+
or <literal>\0</literal> to end reading (depending on the <parameter>mode</parameter>
46
46
parameter, see below).
47
47
</para>
48
48
</listitem>
49
49
</varlistentry>
50
50
<varlistentry>
51
-
<term><parameter>type</parameter></term>
51
+
<term><parameter>mode</parameter></term>
52
52
<listitem>
53
53
<para>
54
-
Optional <parameter>type</parameter> parameter is a named constant:
54
+
Optional <parameter>mode</parameter> parameter is a named constant:
55
55
<itemizedlist>
56
56
<listitem>
57
57
<simpara>
...
...
@@ -91,6 +91,23 @@
91
91
</note>
92
92
</refsect1>
93
93

94
+
<refsect1 role="changelog">
95
+
&reftitle.changelog;
96
+
<informaltable>
97
+
<tgroup cols="2">
98
+
<thead>
99
+
<row>
100
+
<entry>&Version;</entry>
101
+
<entry>&Description;</entry>
102
+
</row>
103
+
</thead>
104
+
<tbody>
105
+
&sockets.changelog.socket-param;
106
+
</tbody>
107
+
</tgroup>
108
+
</informaltable>
109
+
</refsect1>
110
+

94
111
<refsect1 role="seealso">
95
112
&reftitle.seealso;
96
113
<para>
...
...
@@ -107,7 +124,6 @@
107
124
</refsect1>
108
125

109
126
</refentry>
110
-

111
127
<!-- Keep this comment at the end of the file
112
128
Local variables:
113
129
mode: sgml
114
130