Re: simpleXML - simplexml_load_file() timeout?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux