Timing out a remote call

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

 



For one project, I'm required to access a web service for every page. Basically it returns a little bit of random text. I have no control over the web service, and there is no possibility of cacheing or bringing it locally: the requirements are that it be accessed live across the Internet every time.

Most times it's instantaneous, but sometimes it can hang. I want to give it a half-second timeout, which we're allowed to do, but there's no documentation provided. Here is how we call it now (really simple):

  include('http://04planet.info/kfc/grab_one.php');

I have STFW and RTFM and could only find vague references like "use fsockopen instead" or "stream_set_timeout()" but I can't find an actual complete working example anywhere. Any pointers?

--
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