From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4.0.6
PHP Bug Type:     Sockets related
Bug description:  fsockopen() does not timeout

I'm specifying a timeout of 0.2 seconds, but the fsockopen() function is
taking as long as 3-4 seconds with slow domains (I know
www.krasnapolsky.sr to be slow).  This example took about 3.6 seconds.

CODE:
echo microtime();
echo fsockopen("www.krasnapolsky.sr", 80, &$errno, &$errstr, 0.2);
echo microtime();
echo "Error Number = $errno, Error String = $errstr";

RESULT:
0.39859300 1016822517
Resource id #1
0.04482100 1016822521
Error Number = 0, Error String = 

So the socket is opened -- it just took way longer than I intended to
allow it.  Setting the timeout to an integer (e.g. 1) does not work either
(although the documentation says it can be of type float).

I reported this previously under bug 14740, but that thread was related to
win 98 and 2k, where the timeout is not expected to work.
-- 
Edit bug report at http://bugs.php.net/?id=16261&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16261&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16261&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16261&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16261&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16261&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16261&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16261&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16261&r=submittedtwice

Reply via email to