I am having a problem with a network request that should timeout, but the method is not called. The request is as follows:
#define kCONNECT_TIMEOUT 20.0
request = [NSMutableURLRequest requestWithURL: aUrl];
[request setHTTPMethod: @"POST"];
postData = [jsonData dataUsingEncoding:NSASCIIStringEncoding];
[request setHTTPBody:postData];
[request setValue:@"text/xml" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setCachePolicy:NSURLCacheStorageAllowed];
[request setTimeoutInterval:kCONNECT_TIMEOUT];
self.connection = [NSURLConnection connectionWithRequest:request delegate:self];
assert(self.connection != nil);
This should get a callback to
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)_error
But after 4 minutes no error message is displayed. Anyone know why this might be?