What is the situation regarding the NSURLConnection timeout with iOS5?

烂漫一生 提交于 2019-12-04 11:05:36

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!