#34972 [Opn]: STDIN won't allow nonblocking.
From: wez@php.net Date: Mon, 24 Oct 2005 23:27:00 +0000 Subject: #34972 [Opn]: STDIN won't allow nonblocking. References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-87004@lists.php.net to get a copy of this message
ID: 34972
Updated by: wez@php.net
Reported By: VJTD3 at VJTD3 dot com
Status: Open
Bug Type: CGI related
Operating System: Windows/Linux
PHP Version: 5.0.5
New Comment:
FYI, using fgets() with a non-blocking resource makes no sense.
To implement what you're after, use stream_select() and fread(); these
work on stdin just fine.
Previous Comments:
------------------------------------------------------------------------
[2005-10-24 23:07:00] VJTD3 at VJTD3 dot com
Description:
------------
STDIN won't allow nonblocking.
Reproduce code:
---------------
<?php
stream_set_blocking(STDIN, FALSE);
while (1) {
echo 'infinate loop showing nonblocking problem'."\n";
echo 'said:'.fgets(STDIN, 1024);
}
?>
Expected result:
----------------
The test code should be a infinate loop with "infinate loop showing
nonblocking problem" said trillions of times fast like a infinate loop
is suposto do when you make a boo boo. instead it will say it once then
wait for input then wait again etc as a blocked resource is expected.
but "stream_set_blocking(STDIN, FALSE);" should be allowing it to do
the loop unblocked resulting in major screen flooding yet unblocking
the resource is ignored.
This means you can't do something like a client program in your shell
that is "interactive" like a Telnet client or similar.
I can dig the whole not reading as typing because that would be too
"raw" for common usage... [ie phrasing the backspaces etc though maybe
a seperate abaility? this would allow arrow key kinda stuff and
similar...] But waiting for a "\n" or whatever file ending shouldn't
have any effect on that loop. It should act just like a TCP or any
other connection when unblocked there the resource just has a return of
no data.
"php -f test.php" I use to run it.
Actual result:
--------------
uses blocking when "stream_set_blocking(STDIN, FALSE);" was used.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34972&edit=1
Thread (44 messages)
- #34972 [Opn]: STDIN won't allow nonblocking.
- #34972 [Opn]: STDIN won't allow nonblocking.
- #34972 [Opn->Asn]: STDIN won't allow nonblocking.
- #34972 [Asn->Fbk]: STDIN won't allow nonblocking.
- #34972 [Fbk->Opn]: STDIN won't allow nonblocking.
- #34972 [Opn->Asn]: STDIN won't allow nonblocking.
- #34972 [Asn]: STDIN won't allow nonblocking.
- #34972 [Asn]: STDIN won't allow nonblocking.
- #34972 [Asn->Fbk]: STDIN won't allow nonblocking.
- #34972 [NoF->Opn]: STDIN won't allow nonblocking.
- #34972 [Com]: STDIN won't allow nonblocking.
- #34972 [Com]: STDIN won't allow nonblocking.
- #34972 [Opn->Fbk]: STDIN won't allow nonblocking.
- #34972 [Fbk->Opn]: STDIN won't allow nonblocking.
- #34972 [Opn]: STDIN won't allow nonblocking.
- #34972 [Opn->Asn]: STDIN won't allow nonblocking.
- #34972 [Asn]: STDIN won't allow nonblocking.
- #34972 [Asn->Fbk]: STDIN won't allow nonblocking.
- #34972 [Fbk->Opn]: STDIN won't allow nonblocking.
- #34972 [Opn->Asn]: STDIN won't allow nonblocking.
- #34972 [Com]: STDIN won't allow nonblocking.
- #34972 [Com]: STDIN won't allow nonblocking.
- #34972 [Com]: STDIN won't allow nonblocking.
- #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Asn]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Asn->Opn]: STDIN won't allow nonblocking.
- Bug #34972 [Com]: STDIN won't allow nonblocking.
- Bug #34972 [Opn]: STDIN should allow nonblocking
- Req #34972 [Com]: STDIN should allow nonblocking
- Req #34972 [Com]: STDIN should allow nonblocking
| « previous | php.bugs (#87004) | next » |
|---|