Re: simpleXML - simplexml_load_file() timeout?
| From: | Richard Lynch | Date: | Tue, 11 Apr 2006 01:44:19 +0000 |
| Subject: | Re: simpleXML - simplexml_load_file() timeout? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233718@lists.php.net to get a copy of this message | ||
> When I do get something figured out I will post results here. Problem
> is, with
> either method I need to find a feed that is slow to test with. If I
> test it
> with a bunk url it will just 404 immediately right? Is there a way to
> simulate a slow connection?
I dunno about similating a slow connection, but you can write a very
slow server... :-)
my_slow_rss_feed.php
<?php
$data = '<name>Darren Kirby</name>';
sleep(10);
for ($i = 0; $i < strlen($data); $i++){
echo $data[$i];
flush();
sleep(1);
}
?>
Of course, that doesn't simulate the slow connection part of it...
If you have 2 machines, you can unplug the network cable, start your
script, then plug the cable in after 5 seconds.
That's gonna make it pretty slow to connect, almost for sure. :-)
If anybody is goofy enough to complain about the performance of
strlen() in the for(...) statement, you're clearly not paying
attention. :-) :-) :-)
--
Like Music?
http://l-i-e.com/artists.htm