From: rob at rem5 dot com
Operating system: NIX 2.4.x
PHP version: 5.0.0
PHP Bug Type: Feature/Change Request
Bug description: stream_set_timeout does not allow you to disable timeout
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 bug report at http://bugs.php.net/?id=29569&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29569&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29569&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29569&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29569&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29569&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29569&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29569&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29569&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29569&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29569&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29569&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29569&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29569&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29569&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29569&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29569&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29569&r=float