note 104949 deleted from function.socket-last-error by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 Jul 2011 14:24:57 +0000 |
| Subject: | note 104949 deleted from function.socket-last-error by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181649@lists.php.net to get a copy of this message | ||
Note Submitter: raphael c.
----
Hmm.. I'm using this to report errors:
<?php
// Create server and set options
$sock = @socket_create(AF_INET, SOCK_STREAM, 0) or ($error[] = socket_last_error());
$sb = @socket_bind($sock, _IP, _PORT) or ($error[] = socket_last_error());
$sl = @socket_listen($sock) or ($error[] = socket_last_error());
// Check for errors
if (!$sock or !$sb or !$sl):
foreach ($error as $errno):
$errstr = socket_strerror($errno);
console_print($errstr);
endforeach;
@socket_close($sock);
exit(0);
endif;
?>