Fw: PHP script needs to timeout upon FOPEN to URL
| From: | Phil Powell | Date: | Fri, 13 Dec 2002 23:13:55 +0000 |
| Subject: | Fw: PHP script needs to timeout upon FOPEN to URL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-128222@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "soazine@pop.erols.com" <soazine@pop.mail.rcn.net>
To: <soazine@erols.com>
Sent: Friday, December 13, 2002 5:13 PM
Subject: PHP script needs to timeout upon FOPEN to URL
I have the following line:
while (!($file = @fopen("http://www.myurl.com",
"r")) && time() <
$startTime + $time);
if (!$file){
echo "Timed out, try again later";
} else {
// do stuff
}
Problem is, when it attempts to connect to the remote server, it's supposed
to time out after 2-5 seconds, but it doesn't, it just locks up :( Any
suggestions?
Phil
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .