Hi !

I use the file function for accessing to pages on another server.

It works perfectly.

But if the server does not respond or is too long to send datas, the file 
function wait too long..

Is there a way to tune the time out ?? I would like that id the server does 
not respond, the function return in few seconds only.

I thought to a solution using :

set_time_limit(2);
register_shutdown_function(func);
file(myurl);
set_time_limit(30);
func();

In this example if the file function takes more than 2 seconds, then func() 
would be called. If the file function does not time out, then then func is 
called too...

But may be there is a cleanest way to do this (I checked the manual, 
somethink like socket_set_timeout), in the way that if the time function 
timed out then the script continues normally, returning an error:

tuning the time out(2);
$f=file(myurl);
if ($f==false)
         // Timed out
else
         // ok
....

Thank you !

jean-arthur

---------------------------------------------------------------

EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr
----------------------------------------------------------------


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to