Bug #70348 [Opn->Fbk]: stream_select fails
| From: | ab@php.net | Date: | Wed, 26 Aug 2015 16:16:29 +0000 |
| Subject: | Bug #70348 [Opn->Fbk]: stream_select fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195538@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70348&edit=1
ID: 70348
Updated by: ab@php.net
Reported by: mwilmes at avc dot edu
Summary: stream_select fails
-Status: Open
+Status: Feedback
Type: Bug
Package: Streams related
Operating System: Win 8.1 x64
PHP Version: 5.6.12
Block user comment: N
Private report: N
New Comment:
Hi,
I don't reproduce this. Probably need a more reliable reproduce case, or you should check your
environment. In the PHP code, checking that the returned socket is valid before select should be
done, too.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2015-08-24 22:05:27] mwilmes at avc dot edu
Description:
------------
Using stream_select on Windows generates a warning:
Warning: stream_select(): unable to select [2]: No such file or directory (max_fd=1168) in
C:\path\x.php on line 8
Should not create an error. Note that fd changes per iteration. Error exists using both CLI and
Apache php5apache2_4.dll.
Test script:
---------------
<?php
$timeout = 15;
$socket = fsockopen("www.google.com",80,$errno,$errstr,$timeout);
fwrite($socket, "GET / HTTP/1.0\r\n\r\n");
echo fgets($socket);
fclose($socket);
echo "<br>";
$socket = fsockopen("www.google.com",80,$errno,$errstr,$timeout);
$sock_r = null;
$sock_w = array($socket);
$sock_e = null;
$result = stream_select($sock_r,$sock_w,$sock_e,$timeout);
if ($result !== false) {
fwrite($socket, "GET / HTTP/1.0\r\n\r\n");
echo fgets($socket);
}
fclose($socket);
?>
Expected result:
----------------
HTTP/1.0 200 OK
<br>
HTTP/1.0 200 OK
Actual result:
--------------
HTTP/1.0 200 OK
Warning: stream_select(): unable to select [2]: No such file or directory (max_fd=1352) in
C:\path\x.php on line 15
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70348&edit=1