note 90343 added to function.socket-accept
| From: | alan at binarystars dot com | Date: | Fri, 17 Apr 2009 02:42:58 +0000 |
| Subject: | note 90343 added to function.socket-accept | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153418@lists.php.net to get a copy of this message | ||
How annoying... w/ PHP 5.2.9 linux.
Beware 'socket_accept' does not return false; instead it returns NULL on error:
# accept the client and create a new socket
if (($new_socket = @socket_accept($master_socket))===false) {
echo "I should be here; but I'm not.";
}
var_dump($master_socket);
var_dump($new_socket);
==================
CLI OUTPUT:
array(1) {
[0]=>
resource(20) of type (Socket)
}
NULL
==================
Where $master_socket should be a single resource.
----
Server IP: 209.41.74.194
Probable Submitter: 74.94.230.73
----
Manual Page -- http://www.php.net/manual/en/function.socket-accept.php
Edit -- https://master.php.net/note/edit/90343
Del: integrated -- https://master.php.net/note/delete/90343/integrated
Del: useless -- https://master.php.net/note/delete/90343/useless
Del: bad code -- https://master.php.net/note/delete/90343/bad+code
Del: spam -- https://master.php.net/note/delete/90343/spam
Del: non-english -- https://master.php.net/note/delete/90343/non-english
Del: in docs -- https://master.php.net/note/delete/90343/in+docs
Del: other reasons-- https://master.php.net/note/delete/90343
Reject -- https://master.php.net/note/reject/90343
Search -- https://master.php.net/manage/user-notes.php