note 89666 added to function.socket-select
| From: | eidberger at jakota dot de | Date: | Wed, 18 Mar 2009 14:06:25 +0000 |
| Subject: | note 89666 added to function.socket-select | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152094@lists.php.net to get a copy of this message | ||
Just noticed that you have to loop socket_select () when using UDP to get all queued packets:
while (socket_select ($aRead, $aWrite, $aExcept, 1) > 0) {
foreach ($aReadUdp as $oSocket) {
$this->clientReadUdp ($oSocket);
}
}
That's important because every call of socket_select () on UDP brings you only one result. But
there could be 10.000 results queued and if your turnarround time is to slow (server busy, other
sleeps etc.), you'll never progress all results in near realtime.
----
Server IP: 69.147.83.197
Probable Submitter: 87.188.151.154
----
Manual Page -- http://www.php.net/manual/en/function.socket-select.php
Edit -- https://master.php.net/note/edit/89666
Del: integrated -- https://master.php.net/note/delete/89666/integrated
Del: useless -- https://master.php.net/note/delete/89666/useless
Del: bad code -- https://master.php.net/note/delete/89666/bad+code
Del: spam -- https://master.php.net/note/delete/89666/spam
Del: non-english -- https://master.php.net/note/delete/89666/non-english
Del: in docs -- https://master.php.net/note/delete/89666/in+docs
Del: other reasons-- https://master.php.net/note/delete/89666
Reject -- https://master.php.net/note/reject/89666
Search -- https://master.php.net/manage/user-notes.php