#48684 [Opn->Fbk]: cant make STDIN non blocking
| From: | pajoye@php.net | Date: | Fri, 11 Dec 2009 22:46:53 +0000 |
| Subject: | #48684 [Opn->Fbk]: cant make STDIN non blocking | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145655@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: Open
+Status: Feedback
Bug Type: Streams related
Operating System: win32 only - Vista X64
PHP Version: 5.2.10
Previous Comments:
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
[2009-06-25 22:43:30] ryan at ryanmills dot net
tested on linux and 32bit windows. Linux works, windows does not.
------------------------------------------------------------------------
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