diff --git a/reference/sockets/functions/socket-select.xml b/reference/sockets/functions/socket-select.xml index aeaf082982..2ee7c70b73 100644 --- a/reference/sockets/functions/socket-select.xml +++ b/reference/sockets/functions/socket-select.xml @@ -1,24 +1,27 @@ - + socket_select - Runs the select() system call on the given arrays of sockets with a timeout specified by tv_sec and tv_usec + + Runs the select() system call on the given arrays of sockets + with a specified timeout + Description intsocket_select - resource&read - resource&write - resource&except + array&read + array&write + array&except inttv_sec inttv_usec &warn.experimental.func; - The socket_select accepts arrays of sockets and + socket_select accepts arrays of sockets and waits for them to change status. Those coming with BSD sockets background will recognize that those socket resource arrays are in fact the so-called file descriptor sets. Three independent arrays of socket @@ -53,8 +56,9 @@ socket_select returns. - Example: - + + <function>socket_select</function> example + - + + @@ -76,11 +81,14 @@ if ($num_changed_sockets === false) { which expects this parameter to be passed by reference. Instead use a temporary variable or an expression with the leftmost member being a temporary variable: - + + Using &null; with <function>socket_select</function> + - + + @@ -105,14 +113,17 @@ socket_select($r, $w, $e = NULL, 0); Be sure to use the === operator when checking for an error. Since the socket_select may return 0 the comparison with == would evaluate to &true;: - + + Understanding <function>socket_select</function>'s result + - + +