ID: 29569 User updated by: rob at rem5 dot com Reported By: rob at rem5 dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: NIX 2.4.x PHP Version: 5.0.0 New Comment:
error with my script and my head. Previous Comments: ------------------------------------------------------------------------ [2004-08-08 06:00:47] rob at rem5 dot com Description: ------------ when trying to keep a stream open using stream_set_timeout it will not allow the connection to stay open. I tried setting it to 0.. as well as 9999999999999999999999999. However it will not stay open more than 30 seconds. Reproduce code: --------------- #!/usr/local/php5/bin/php -qn <?php $socket = stream_socket_server("tcp://0.0.0.0:8000", $errno, $errstr); stream_set_timeout($socket, 99999999999999999999999999999999999999); if (!$socket) { echo "$errstr ($errno)<br />\n"; } else { while ($conn = stream_socket_accept($socket)) { fwrite($conn, "Simple Echo Using stream_socket_server() in PHP"); $foo = fgets($conn); fwrite($conn, $foo); fclose($conn); } fclose($socket); } ?> Expected result: ---------------- stream_socket_server() should stay open and accepting connections. Actual result: -------------- craps out after 30 secs ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29569&edit=1