#32861 [Opn->Fbk]: timeout is ignored in stream_select function
| From: | sniper@php.net | Date: | Wed, 27 Apr 2005 22:05:08 +0000 |
| Subject: | #32861 [Opn->Fbk]: timeout is ignored in stream_select function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78320@lists.php.net to get a copy of this message | ||
ID: 32861
Updated by: sniper@php.net
Reported By: lew at mailduct dot com
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: FreeBSD 4.11-REL
PHP Version: 4.3.10
New Comment:
Does this happen with PHP 4.3.11 or 5.0.4 ?
Previous Comments:
------------------------------------------------------------------------
[2005-04-27 21:53:44] lew at mailduct dot com
Description:
------------
Timeouts are ignored in stream_select. Instead, it always
returns with "1" as the number of streams affected, ignoring
any timeout seconds that are set.
This is true regardless of stream_set_blocking settings.
This may or may not be related to my reported FEOF problems:
pr #25649 (Sep 2003)
pr #32858 (Apr 2005)
Reproduce code:
---------------
$fp = fopen( '/var/log/maillog','r' );
## Tried both ways, got same results
#stream_set_blocking( $fp,TRUE );
#stream_set_blocking( $fp,FALSE );
$r = array( $fp );
while( TRUE ) {
$n = stream_select( $r,$w=NULL,$e=NULL,30 );
if( $n===FALSE ) echo "stream_select = FALSE\n";
else echo "stream_select = $n\n";
echo fgets($fp);
print( '.' );
}
Expected result:
----------------
Assuming no other program is writing to /var/log/maillog, I expect to
see a timeout condition every 30 seconds, as such:
stream_select = FALSE
Actual result:
--------------
Instead, I see iterations of:
stream_select = 1
as fast as the system can execute the loop.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32861&edit=1