note 29467 added to function.socket-select
| From: | calimero dot NOSPAM at NOSPAM dot creatixnet dot com | Date: | Fri, 14 Feb 2003 10:36:00 +0000 |
| Subject: | note 29467 added to function.socket-select | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43928@lists.php.net to get a copy of this message | ||
Please note that the timeout parameter has important side-effects on the CPU usage of your script.
Setting the timeout to 0 will make your CPU looping without any time to have some rest and handle
other running processes on your system, causing the system load to increase heavily while your
script is running.
Personnaly, I use a value of 15 ms for this parameter. this ensures a good listening frequency while
letting your system load clear.
Example :
$read = array($ListeningSocket);
$num_changed_sockets = socket_select($read, $write = NULL, $except = NULL, 0, 10);
Hope this helps.
--
http://www.php.net/manual/en/function.socket-select.php
http://master.php.net/manage/user-notes.php?action=edit+29467
http://master.php.net/manage/user-notes.php?action=delete+29467
http://master.php.net/manage/user-notes.php?action=reject+29467