Bug #60483 [Opn->Fbk]: stream_select only selects STDIN if present in read array
| From: | cataphract@php.net | Date: | Sun, 11 Dec 2011 15:52:24 +0000 |
| Subject: | Bug #60483 [Opn->Fbk]: stream_select only selects STDIN if present in read array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165800@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60483&edit=1
ID: 60483
Updated by: cataphract@php.net
Reported by: vmiszczak at ankama dot com
Summary: stream_select only selects STDIN if present in read
array
-Status: Open
+Status: Feedback
Type: Bug
Package: Streams related
Operating System: Linux/Debian x64
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2011-12-09 15:25:29] vmiszczak at ankama dot com
Description:
------------
I'm writing a data multiplexer PHP CLI script that takes data from STDIN and
dispatchs
those data on programs opened with proc_open().
I'm using stream_select() to see which descriptor has data. The read array I'm
using contains STDIN and the output streams from programs opened with proc_open()
(the classic $pipes[1] from proc_open() descriptorspec). Those programs write on
their stdout as soon as there is data on their stdin (actually those programs are
PHP scripts echoing input). If STDIN remains in the read set, stream_select
returns only STDIN as readable and never returns any of the programs output
streams.
As soon as STDIN is removed from the read set, stream_select behave normaly and
selects the output streams that are ready.
Expected result:
----------------
I'm expecting all my ready streams to be returned, even if STDIN is present in the
set.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60483&edit=1