#48684 [Fbk]: cant make STDIN non blocking
| From: | pajoye@php.net | Date: | Sat, 12 Dec 2009 02:17:07 +0000 |
| Subject: | #48684 [Fbk]: cant make STDIN non blocking | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145664@lists.php.net to get a copy of this message | ||
ID: 48684
Updated by: pajoye@php.net
Reported By: ryan at ryanmills dot net
Status: Feedback
Bug Type: Streams related
Operating System: win32 only - Vista X64
PHP Version: 5.2.10
New Comment:
Ok, please provide a link to the patch once you are ready, pastie.org
will do it, not a website where we have to register to fetch it.
Previous Comments:
------------------------------------------------------------------------
[2009-12-12 02:00:10] spam at helper3000 dot net
http://rapidshare.com/files/319636981/php-5.3.1L.zip.html
He's refining it more and as so includes no source.
------------------------------------------------------------------------
[2009-12-11 22:46:48] pajoye@php.net
And where is the patch then?
------------------------------------------------------------------------
[2009-12-11 22:43:54] spam at helper3000 dot net
Would also just like to add that after a mere day, a busy friend I know
managed to fix PHP 5.2 and apply the patch to 5.3, it now works
perfectly using his modified build.
UNDER A DAY. And this issue has been continuing in PHP for at least 7
years...
------------------------------------------------------------------------
[2009-12-08 20:59:57] spam at helper3000 dot net
Problem experianced using 5.3.1 in both thread and non-thread safe
binaries on windows XP SP2.
I too have read that it is an ongoing problem; it should have been
fixed many years ago.
------------------------------------------------------------------------
[2009-10-20 23:32:06] ron at rongage dot org
Actually, it still doesn't work on Linux either (5.2.11).
Yes, the actual fread is non-blocking. However, if you press any key,
it is NOT registered so you can't react to keystrokes.
The code:
<?php
stream_set_blocking(STDIN,FALSE);
while (1)
{
$x = fread(STDIN,1);
var_dump($x);
if ($x != "")
exit;
}
As expected with non-blocking, the fread doesn't hold up execution of
the program. However, if a key is hit (something comes in on STDIN),
the program should immediately exit. It doesn't - it just keeps on
going, and going, and going....
Ron
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48684
--
Edit this bug report at http://bugs.php.net/?id=48684&edit=1