I'm trying to find a definitive answer to if it possible to set the timeout value for using NSURLConnection in iOS 5 (I would like to set it to 30 seconds).
I've searched past postings on this but the information seems contradictory. For example, this posting
says Apple mandates a 4 minute minimum timeout - though I cannot find any Apple documentation to support this.
THis posting says the 240 limit comes from an apple forum thread NSMutableURLRequest not obeying my timeoutInterval
They say this limit is only for POSTs when the body isn't empty. Does that imply its possible to set the timeout less than 4 minutes for GETS?
Somebody commented here that that's not the case with iOS 5, however they were down voted NSMutableURLRequest not obeying my timeoutInterval
And there's other's saying other things but anyway most of the previous postings on this topic seem to be from a couple of years ago prior to iOS 5.
If there is a 4 minute limit then having to rely on hearsay to know this is a bit ridiculous if there truly is no Apple documentation.
Does anybody know the actual definitive situation on this for iOS 5.
It is not the connection that has an associated timeout, it is the request (that is made over the connection). See the documentation for NSURLRequest. The timeout interval is measured in seconds (not minutes, which is but a clue).
Return Value The receiver's timeout interval, in seconds.
Discussion If during a connection attempt the request remains idle for longer than the timeout interval, the request is considered to have timed out.*
Various Apple code and documentation show timeouts of 60 seconds; thus 4 minutes can't be the minimum.
In my experience I have found that: - Its possible to set a timeout value of anything (i.e. 0.1 seconds) for HTTP GETS. - The OS does impose a limit of 240 for HTTP POSTS with a body.