Re: Checking availability of host/website

2008-06-28 Thread Omar Qazi


On Jun 28, 2008, at 12:36 AM, Michael Kaye wrote:


I have implemented an SCNetworkReachAbility based method to test  
firstly whether a network is available, but I was wondering in your  
opinion what is the best way to check that the remote host/website  
is responding to requests?



It depends on what your definition of availability is. If you want to  
ping the server you can wrap a ping command through NSTask. If you  
want to check if it responds to connections, NSURLConnection is for  
you. If you want to check if the system is connected to the internet  
you would use the api for that.


You probably just want to open an NSURLConnection and see if it  
doesn't accept the connection within a second or whatever.


Omar Qazi
Hello, Galaxy!
1.310.294.1593



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Checking availability of host/website

2008-06-28 Thread Michael Kaye

Hi all,

Another newbie here so be gentle...

I have a small app that needs to send a number of requests to a remote  
server.


I have implemented an SCNetworkReachAbility based method to test  
firstly whether a network is available, but I was wondering in your  
opinion what is the best way to check that the remote host/website is  
responding to requests?


Obviously I want any check to be an quick as possible as I don't want  
the user to be sitting waiting on a time out etc.


I can think of a number of ways to do this ; ping (but I've no idea  
how to do this); creating a connection using NSConnection or NSURL etc.


Can anyone offer any advice/suggestions for the most sensible way to  
achieve this?


Thanks in advance, Michael.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]