It appears to me that something is strange with the socket_select function.
>From what I understand the value of the fourth parameter, tv_sec,
should block the execution of the script for that number of seconds.
I tried this code :
$serverSocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$result = socket_bind($serverSocket, "127.0.0.1", "20668");
$start = time();
$reads = array($serverSocket);
$writes = null;
$except = null;
$changes = socket_select($reads, $writes, $except, 5);
$now = time();
echo $now - $start;
and when I run it with php -q server3.php the ouput shows something
like 0 0 0 0 0 1 1 1 1 1 2 2 2 2 etc so the script doesn't pause on
socket_select until it returns.
Cam somebody explain me what's happening ?
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php