#40458 [Opn->Fbk]: stream_select
| From: | tony2001@php.net | Date: | Tue, 13 Feb 2007 09:09:36 +0000 |
| Subject: | #40458 [Opn->Fbk]: stream_select | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108786@lists.php.net to get a copy of this message | ||
ID: 40458
Updated by: tony2001@php.net
Reported By: roberto at spadim dot com dot br
-Status: Open
+Status: Feedback
-Bug Type: *General Issues
+Bug Type: Streams related
Operating System: linux 64bits
PHP Version: 5.2.1
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:
------------------------------------------------------------------------
[2007-02-13 04:44:49] roberto at spadim dot com dot br
Description:
------------
hello i was using archlinux 32 bits version on pentium3
i bought an intel core 2 duo e6600 and i'm using archlinux 64
my code on 32 bits was using
$read = array($stream);
if (false === ($num_changed_streams = stream_select($read, $write =
NULL, $except = NULL, 1,0))){
on 32 bits ok, it wait one second or if data received return with
num_changed_stream>0
on 64 bits no, it return imediatly and num_changed_stream=0, since
tcpdump didn't show nothing i think that's an 64bits bug
i created $stream with:
$stream = stream_socket_client("tcp://172.16.0.1:515", $this->errNo,
$this->errStr, $this->timeout);
stream_set_write_buffer($stream,0);
stream_set_blocking($stream,1);
stream_set_timeout($stream,2,0);
Reproduce code:
---------------
<?
$stream = stream_socket_client("tcp://172.16.0.1:515", $this->errNo,
$this->errStr, $this->timeout);
stream_set_write_buffer($stream,0);
stream_set_blocking($stream,1);
stream_set_timeout($stream,2,0);
$read = array($stream);
echo microtime(0)."\n";
$num_changed_streams = stream_select($read, $write = NULL, $except =
NULL, 1,0);
echo microtime(0)."\n";
?>
Expected result:
----------------
a long time (1 second of diff)
Actual result:
--------------
on 32bits php ok
on 64 bits php return .0010 seconds of diff and tcpdump didn't showed
nothing on this stream
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40458&edit=1