I'm trying to download a small data file using NSURLSession
, but the completion handler is never called (where "never" means I waited long after the specified timeout).
NSURLSessionConfiguration* config =
NSURLSessionConfiguration.ephemeralSessionConfiguration;
config.timeoutIntervalForResource = 120.0;
config.timeoutIntervalForRequest = 120.0;
NSURLSession* session = [NSURLSession sessionWithConfiguration: config];
[session dataTaskWithURL: inURL
completionHandler:
^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error)
{
...
}];
I'm trying to update some old code that used the deprecated NSURLConnection
class, and am using the same URL, so I know that the URL is good.