ID:               32688
 Updated by:       [EMAIL PROTECTED]
 Reported By:      rene dot vogt at cnlab dot ch
-Status:           Open
+Status:           Feedback
 Bug Type:         Sockets related
 Operating System: Windows 2003 Server
 PHP Version:      5.0.4
 New Comment:

With what version it worked before?
I doubt it could work at all in the way you describe, because in this
situation there is _no timeout_, it's quite expected situation: you
open a stream and read the data from it, so why should it timeout? 


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

[2005-04-12 23:46:03] rene dot vogt at cnlab dot ch

Description:
------------
The function stream_set_timeout seems not to work on php 5.0.4 (win32).
It worked with earlier php versions.
The sample code connects to a page on a server which prints out a dot
every second. After 3 seconds the script should terminate.

http://verkehr.cnlab.ch/test1.php (sample code) 
http://verkehr.cnlab.ch/test2.php (produces dots)

Reproduce code:
---------------
<?php
 $fp = fsockopen("verkehr.cnlab.ch", 80, $errno, $errstr, 3);
 if (!$fp) {
   return "Error connecting";
 } else {
   stream_set_timeout($fp, 3);
   fwrite($fp,"GET /test2.php HTTP/1.0\r\nHost:
verkehr.cnlab.ch:80\r\nConnection: Close\r\n\r\n");
   while (!feof($fp)) {
     echo fread($fp, 512);flush(); ob_flush();
   }
   fclose($fp);
}
?>

Expected result:
----------------
Prints out 3 dots and abort


Actual result:
--------------
Print out dots until page timeout


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


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

Reply via email to