#44605 [Opn]: stream_select() does not work with stdout

From: Date: Wed, 02 Apr 2008 09:18:02 +0000
Subject: #44605 [Opn]: stream_select() does not work with stdout
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123847@lists.php.net to get a copy of this message
ID: 44605 Updated by: jani@php.net Reported By: jc_mammana at hotmail dot com Status: Open Bug Type: Streams related Operating System: Win32 PHP Version: 5.2.5 New Comment: It works fine with the "stock" STDOUT but not when you open the thing "manually". This works (or at least does not give me any errors :) <?php $sw = array(STDOUT); $sr = $se = NULL; $r = stream_select($sr, $sw, $se, 3); fwrite(STDOUT, "hello php world!" ); flush(); ?> Previous Comments: ------------------------------------------------------------------------ [2008-04-02 08:25:44] jc_mammana at hotmail dot com Description: ------------ This code gave me an error : # $stdout = fopen("php://output", "wb" ); # (...) # $sw = array($stdout); # $sr = $se = NULL; # $r = stream_select($sr, $sw, $se, 3); # fwrite($stdout, "hello php world!" ); # flush(); So there is no way to detect if the client is able to receive data (in case of non gracefully disconnection). Expected result: ---------------- stream_select should return 0 (for timeout reason) if the client is disconnected. Actual result: -------------- PHP ERROR : cannot represent a stream of type Output as a select()able descriptor ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44605&edit=1

« previous php.bugs (#123847) next »