mzeeshanid / MZDownloadManager

This download manager uses NSURLSession api to download files. It can download multiple files at a time. It can download large files if app is in background. It can resume downloads if app was quit.
BSD 3-Clause "New" or "Revised" License
1.12k stars 238 forks source link

timeoutIntervalForRequest does not work #14

Closed dodosp closed 7 years ago

dodosp commented 9 years ago

I have set timeoutIntervalForRequest in the session configuration and tried with a URL that gives a timeout "http://www.google.com:81/" but the timeout is not triggered, didFinishWithError is not called. On the contrary if i ser timeoutIntervalForResponse this timeout is triggered. Maybe you have some insight?

mzeeshanid commented 7 years ago

In general, an NSURLSession background session does not fail a task if something goes wrong on the wire. Rather, it continues looking for a good time to run the request and retries at that time. This continues until the resource timeout expires (that is, the value of the timeoutIntervalForResource property in the NSURLSessionConfiguration object you use to create the session). The current default for that value is one week!

For more details