ID:               32058
 Updated by:       [EMAIL PROTECTED]
 Reported By:      alan at ridersite dot org
-Status:           Open
+Status:           Feedback
 Bug Type:         Sockets related
 Operating System: BSD
 PHP Version:      4.3.10
 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 possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.




Previous Comments:
------------------------------------------------------------------------

[2005-02-21 23:14:57] alan at ridersite dot org

Description:
------------
It appears to me that stream_set_timout() does not do anything of
value.  

You can set it prior to a while loop; but, it does nothing to help you
exit the loop if the time expires. e.g.,
 
stream_set_timeout($fp, 20);    

$status = socket_get_status($fp);
while (!feof($fp) && !$status['timed_out']) {
    $chunk = fread($fp, 10000);
    $length = strlen($chunk);
    $html_str .= $chunk;
    sleep(2);
    $status = socket_get_status($fp);
} //end while, fetching data

If fread() hangs up, the script hangs.  

You can do exactly the same thing by simply keeping track of elapsed
time in the loop. 

Set stream_set_blocking($fp, FALSE ) so fread() keeps going and the
loop continues until the elapsed time expires. 

 




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32058&edit=1

Reply via email to