Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2006



Tip: Looking for answers? Try searching our database.

timeout on url requests?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Santa Claus - 29 Oct 2006 23:31 GMT
Currently, i use the following:
[tmp1 setString: [NSString stringWithContentsOfURL: [NSURL URLWithString: @"http://www.SomeWebSite.com/"] encoding: NSASCIIStringEncoding error: nil]];
is there a way to set it to a timeout of 1-2 seconds if the website doesn't respond in that period of time?  I don't want the user to wait the full 3-4 minutes before the system times out if the site's not available.
David Phillip Oster - 30 Oct 2006 01:58 GMT
> Currently, i use the following:
> [tmp1 setString: [NSString stringWithContentsOfURL: [NSURL URLWithString:
> @"http://www.SomeWebSite.com/"] encoding: NSASCIIStringEncoding error: nil]];
> is there a way to set it to a timeout of 1-2 seconds if the website doesn't
> respond in that period of time?  I don't want the user to wait the full 3-4
> minutes before the system times out if the site's not available.

You can make a NSURLRequest with a NSURL and set the timeout time. Use a
NSURLConnection to run the NSURLRequest.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.