Doc #60273 [NEW]: stream-set-timeout not clear about how it works and how it should be used

From: Date: Fri, 11 Nov 2011 19:50:00 +0000
Subject: Doc #60273 [NEW]: stream-set-timeout not clear about how it works and how it should be used
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7421@lists.php.net to get a copy of this message
From: Operating system: PHP version: trunk-SVN-2011-11-11 (SVN) Package: Documentation problem Bug Type: Documentation Problem Bug description:stream-set-timeout not clear about how it works and how it should be used Description: ------------ --- From manual page: http://www.php.net/function.stream-set-timeout#refsect1-function.stream-set-timeout-description --- It is not clear to me if it refers to a timeout since the last byte received from the stream or a timeout since the stream has been opened. For example, if I set a timeout of 5 seconds with this function, if I receive data without problems, will it stop at 5 seconds even if I am receiving data? Or will it stop after not receiving data for 5 seconds? And, what is the default timeout? Also, some people say that you should call it everytime after a fwrite otherwise the fread will not timeout. Other people say that before doing the fread one should check the timed_out field of the array returned by stream_get_meta_data. Someone with the right knowledge should improve the documentation substantially since its not clear at all. The example should be done with a loop to show people how to read correctly with timeout handling in a loop since fread can bring less data than there is really available or requested. Thanks. -- Edit bug report at https://bugs.php.net/bug.php?id=60273&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60273&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60273&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60273&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60273&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60273&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60273&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60273&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60273&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60273&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60273&r=support Expected behavior: https://bugs.php.net/fix.php?id=60273&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60273&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60273&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60273&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60273&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60273&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60273&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60273&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60273&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60273&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60273&r=mysqlcfg

« previous php.doc.bugs (#7421) next »