reference/sockets/functions/socket-accept.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-accept">
3
+
<refentry xml:id="function.socket-accept" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>socket_accept</refname>
6
6
<refpurpose>Accepts a connection on a socket</refpurpose>
...
...
@@ -9,8 +9,8 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>resource</type><methodname>socket_accept</methodname>
13
-
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
12
+
<type class="union"><type>Socket</type><type>false</type></type><methodname>socket_accept</methodname>
13
+
<methodparam><type>Socket</type><parameter>socket</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
After the socket <parameter>socket</parameter> has been created
...
...
@@ -18,9 +18,9 @@
18
18
<function>socket_bind</function>, and told to listen for connections
19
19
with <function>socket_listen</function>, this function will accept
20
20
incoming connections on that socket. Once a successful connection
21
-
is made, a new socket resource is returned, which may be used
22
-
for communication. If there are multiple connections queued on
23
-
the socket, the first will be used. If there are no pending
21
+
is made, a new <classname>Socket</classname> instance is returned,
22
+
which may be used for communication. If there are multiple connections
23
+
queued on the socket, the first will be used. If there are no pending
24
24
connections, <function>socket_accept</function> will block until
25
25
a connection becomes present. If <parameter>socket</parameter>
26
26
has been made non-blocking using
...
...
@@ -28,7 +28,7 @@
28
28
<function>socket_set_nonblock</function>, &false; will be returned.
29
29
</para>
30
30
<para>
31
-
The socket resource returned by
31
+
The <classname>Socket</classname> instance returned by
32
32
<function>socket_accept</function> may not be used to accept new
33
33
connections. The original listening socket
34
34
<parameter>socket</parameter>, however, remains open and may be
...
...
@@ -44,7 +44,7 @@
44
44
<term><parameter>socket</parameter></term>
45
45
<listitem>
46
46
<para>
47
-
A valid socket resource created with <function>socket_create</function>.
47
+
A <classname>Socket</classname> instance created with <function>socket_create</function>.
48
48
</para>
49
49
</listitem>
50
50
</varlistentry>
...
...
@@ -55,7 +55,7 @@
55
55
<refsect1 role="returnvalues">
56
56
&reftitle.returnvalues;
57
57
<para>
58
-
Returns a new socket resource on success, or &false; on error. The actual
58
+
Returns a new <classname>Socket</classname> instance on success, or &false; on error. The actual
59
59
error code can be retrieved by calling
60
60
<function>socket_last_error</function>. This error code may be passed to
61
61
<function>socket_strerror</function> to get a textual explanation of the
...
...
@@ -63,6 +63,29 @@
63
63
</para>
64
64
</refsect1>
65
65

66
+
<refsect1 role="changelog">
67
+
&reftitle.changelog;
68
+
<informaltable>
69
+
<tgroup cols="2">
70
+
<thead>
71
+
<row>
72
+
<entry>&Version;</entry>
73
+
<entry>&Description;</entry>
74
+
</row>
75
+
</thead>
76
+
<tbody>
77
+
<row>
78
+
<entry>8.0.0</entry>
79
+
<entry>
80
+
On success, this function returns a <classname>Socket</classname> instance now;
81
+
previously, a <type>resource</type> was returned.
82
+
</entry>
83
+
</row>
84
+
</tbody>
85
+
</tgroup>
86
+
</informaltable>
87
+
</refsect1>
88
+

66
89
<refsect1 role="seealso">
67
90
&reftitle.seealso;
68
91
<para>
...
...
@@ -77,7 +100,6 @@
77
100
</refsect1>
78
101

79
102
</refentry>
80
-

81
103
<!-- Keep this comment at the end of the file
82
104
Local variables:
83
105
mode: sgml
84
106