Re: checking the status of a website from an application
Re: checking the status of a website from an application
- Subject: Re: checking the status of a website from an application
- From: Matt Neuburg <email@hidden>
- Date: Fri, 24 Dec 2004 10:18:33 -0800
On Thu, 23 Dec 2004 23:31:21 +0000, Peter Browne
<email@hidden> said:
>If the website is online then the
>dictionary is initialised with the contents of the URL, but if there is
>a change of state and the site goes down after a while (or goes back up
>if it was down to begin with) then the program hangs.
>
> radioCheck = [NSDictionary dictionaryWithContentsOfURL:[NSURL
>URLWithString:@"http://www.noopaala.com/stuff/famcatsInfo.xml"]]; //
>Create the dictionary
dictionaryWithContentsOfURL is a pretty simple-minded way to check a remote
URL, and it's probably synchononous (explainint the hang). I use NSTask and
'curl'; this gives a lot of control, it's asynchronous, and if there's an
error/timeout you get back a useful result. (There are other ways but I find
this particularly easy.) m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden