This answer explains the minimum value of the timeoutIntervalobject NSURLRequest. If you need a lower value, you can do this by running NSTimer at the right time and in the timer firing method, you will disconnect the connection of your NSURLConnection object. How in:
connection = [[NSURLConnection connectionWithRequest:request delegate:self] retain];
[request release];
[connection start];
if (timer == NULL) {
timer = [NSTimer scheduledTimerWithTimeInterval: TimeOutSecond
target: self
selector: @selector(cancelURLConnection:)
userInfo: nil
repeats: NO];
[timer retain];
}
- (void)cancelURLConnection:(NSTimer *)timerP {
[connection cancel];
NSLog(@"Connection timeout.");
[timer invalidate];
}
source
share