note 49836 deleted from function.clearstatcache by nlopess
| From: | nlopess@php.net | Date: | Tue, 27 Dec 2005 14:46:19 +0000 |
| Subject: | note 49836 deleted from function.clearstatcache by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100794@lists.php.net to get a copy of this message | ||
Note Submitter: Adi Feldman (Adi at Rogers dot com)
----
This function also applies under circumstances where fsockopen() is used. I tried to make a small
loop that retries to connect a certain number of times before giving up, and it simply skipped over
the retry connections and passed them as failures. Adding clearstatcache() between each retry did
the trick.
This will NOT retry connecting after the first failure:
do {
$connection=fsockopen("some_host_or_ip");
} while (!$connection);
This will retry connecting after each failure:
do {
$connection=fsockopen("somewebsite");
clearstatcache();
} while (!$connection);