reference/sockets/functions/socket-select.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-select">
3
+
<refentry xml:id="function.socket-select" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>socket_select</refname>
6
6
<refpurpose>Runs the select() system call on the given arrays of sockets with a specified timeout</refpurpose>
...
...
@@ -9,18 +9,18 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>int</type><methodname>socket_select</methodname>
13
-
<methodparam><type>array</type><parameter role="reference">read</parameter></methodparam>
14
-
<methodparam><type>array</type><parameter role="reference">write</parameter></methodparam>
15
-
<methodparam><type>array</type><parameter role="reference">except</parameter></methodparam>
16
-
<methodparam><type>int</type><parameter>tv_sec</parameter></methodparam>
17
-
<methodparam choice="opt"><type>int</type><parameter>tv_usec</parameter><initializer>0</initializer></methodparam>
12
+
<type class="union"><type>int</type><type>false</type></type><methodname>socket_select</methodname>
13
+
<methodparam><type class="union"><type>array</type><type>null</type></type><parameter role="reference">read</parameter></methodparam>
14
+
<methodparam><type class="union"><type>array</type><type>null</type></type><parameter role="reference">write</parameter></methodparam>
15
+
<methodparam><type class="union"><type>array</type><type>null</type></type><parameter role="reference">except</parameter></methodparam>
16
+
<methodparam><type class="union"><type>int</type><type>null</type></type><parameter>seconds</parameter></methodparam>
17
+
<methodparam choice="opt"><type>int</type><parameter>microseconds</parameter><initializer>0</initializer></methodparam>
18
18
</methodsynopsis>
19
19
<para>
20
20
<function>socket_select</function> accepts arrays of sockets and waits for
21
21
them to change status. Those coming with BSD sockets background will
22
-
recognize that those socket resource arrays are in fact the so-called file
23
-
descriptor sets. Three independent arrays of socket resources are watched.
22
+
recognize that those socket arrays are in fact the so-called file
23
+
descriptor sets. Three independent arrays of sockets are watched.
24
24
</para>
25
25
</refsect1>
26
26

...
...
@@ -35,7 +35,7 @@
35
35
The sockets listed in the <parameter>read</parameter> array will be
36
36
watched to see if characters become available for reading (more
37
37
precisely, to see if a read will not block - in particular, a socket
38
-
resource is also ready on end-of-file, in which case a
38
+
is also ready on end-of-file, in which case a
39
39
<function>socket_read</function> will return a zero length string).
40
40
</para>
41
41
</listitem>
...
...
@@ -59,22 +59,22 @@
59
59
</listitem>
60
60
</varlistentry>
61
61
<varlistentry>
62
-
<term><parameter>tv_sec</parameter></term>
62
+
<term><parameter>seconds</parameter></term>
63
63
<listitem>
64
64
<para>
65
-
The <parameter>tv_sec</parameter> and <parameter>tv_usec</parameter>
65
+
The <parameter>seconds</parameter> and <parameter>microseconds</parameter>
66
66
together form the <literal>timeout</literal> parameter. The
67
67
<literal>timeout</literal> is an upper bound on the amount of time
68
68
elapsed before <function>socket_select</function> return.
69
-
<parameter>tv_sec</parameter> may be zero , causing
69
+
<parameter>seconds</parameter> may be zero , causing
70
70
<function>socket_select</function> to return immediately. This is useful
71
-
for polling. If <parameter>tv_sec</parameter> is &null; (no timeout),
71
+
for polling. If <parameter>seconds</parameter> is &null; (no timeout),
72
72
<function>socket_select</function> can block indefinitely.
73
73
</para>
74
74
</listitem>
75
75
</varlistentry>
76
76
<varlistentry>
77
-
<term><parameter>tv_usec</parameter></term>
77
+
<term><parameter>microseconds</parameter></term>
78
78
<listitem>
79
79
<para>
80
80
</para>
...
...
@@ -84,7 +84,7 @@
84
84
</para>
85
85
<warning>
86
86
<para>
87
-
On exit, the arrays are modified to indicate which socket resource
87
+
On exit, the arrays are modified to indicate which socket
88
88
actually changed status.
89
89
</para>
90
90
</warning>
...
...
@@ -121,8 +121,8 @@ socket_select($r, $w, $e, 0);
121
121
&reftitle.returnvalues;
122
122
<para>
123
123
On success <function>socket_select</function> returns the number of
124
-
socket resources contained in the modified arrays, which may be zero if
125
-
the timeout expires before anything interesting happens. On error &false;
124
+
sockets contained in the modified arrays, which may be zero if
125
+
the timeout expires before anything interesting happens.On error &false;
126
126
is returned. The error code can be retrieved with
127
127
<function>socket_last_error</function>.
128
128
</para>
...
...
@@ -192,12 +192,12 @@ if ($num_changed_sockets === false) {
192
192
</listitem>
193
193
<listitem>
194
194
<simpara>
195
-
No socket resource must be added to any set if you do not intend to
195
+
No socket must be added to any set if you do not intend to
196
196
check its result after the <function>socket_select</function> call,
197
197
and respond appropriately. After <function>socket_select</function>
198
-
returns, all socket resources in all arrays must be checked. Any
199
-
socket resource that is available for writing must be written to, and
200
-
any socket resource available for reading must be read from.
198
+
returns, all sockets in all arrays must be checked. Any
199
+
socket that is available for writing must be written to, and
200
+
any socket available for reading must be read from.
201
201
</simpara>
202
202
</listitem>
203
203
<listitem>
...
...
@@ -233,7 +233,6 @@ if ($num_changed_sockets === false) {
233
233
</refsect1>
234
234

235
235
</refentry>
236
-

237
236
<!-- Keep this comment at the end of the file
238
237
Local variables:
239
238
mode: sgml
240
239