note 44096 deleted from function.stream-socket-accept by tomsommer
| From: | tomsommer@php.net | Date: | Fri, 16 Jul 2004 16:30:13 +0000 |
| Subject: | note 44096 deleted from function.stream-socket-accept by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73397@lists.php.net to get a copy of this message | ||
Note Submitter: scott@slerman.net
----
The timeout value is how long stream_socket_accept will listen for an incoming connection; if no
connection is attempted within the timeout, a warning will be generated saying that the accept timed
out. Most of the time, you want the socket to wait indefinitely, which (judging by this manual page)
appears to be the behavior if you leave out the timeout argument. Unfortunately, if you want the
address that's connecting to your server, you have to include a timeout value. To make the
socket wait indefinitely, use a timeout of -1, i.e. $connection_socket =
stream_socket_accept($listen_socket, -1, $remote_address);