Re: [PHP] fsockopen() to remote URL: what if remote URL "times out"?

2003-01-10 Thread Maxim Maletsky

"Phil Powell" <[EMAIL PROTECTED]> wrote... :

> I have a question about the usage of fsockopen() to open and "scrape" the contents 
>of a remote URL: if the contents take a very long time to load on the remote URL 
>either due to server or coding issues, is there a way for the socket on the PHP end 
>to time out, that is, quit trying to "scrape" contents from the remote site and post 
>a default message instead?


Yes, it is the last parameter of the fsockopen() function. Normally, it
will be set to something like 30 seconds, you might adjust it to
whatever you like. After that time you will get error 110 which means
"Connection timed out". Additionally, if you set anything over 30
seconds, you might also consider altering the execution time limit for
the php script itself.



--
Maxim Maletsky
[EMAIL PROTECTED]



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




[PHP] fsockopen() to remote URL: what if remote URL "times out"?

2003-01-10 Thread Phil Powell
I have a question about the usage of fsockopen() to open and "scrape" the contents of 
a remote URL: if the contents take a very long time to load on the remote URL either 
due to server or coding issues, is there a way for the socket on the PHP end to time 
out, that is, quit trying to "scrape" contents from the remote site and post a default 
message instead?

Just wondering
Thanx
Phil