title: NSURLConnection 60 sec timeout max for GET?
body: <p>I am using RestKit for my project, and i need timeout for my request something like 10-20 minutes(600 - 1200 sec.)
  I am able to change timeout from 1 to 60 sec  and this works without any issues. But when I try to set more that 60 sec (90-9999999)  i receive timeout error after 60 seconds. There is such code in RKRequest.m :</p>
  
  <pre><code>- (void)fireAsynchronousRequest {
      RKLogDebug(@"Sending asynchronous %@ request to URL %@.", [self HTTPMethod], [[self URL] absoluteString]);
      if (![self prepareURLRequest]) {
          // TODO: Logging
          return;
      }
      _isLoading = YES;
  
      if ([self.delegate respondsToSelector:@selector(requestDidStartLoad:)]) {
          [self.delegate requestDidStartLoad:self];
      }
  
      RKResponse* response = [[[RKResponse alloc] initWithRequest:self] autorelease];
  
      _connection = [[NSURLConnection connectionWithRequest:_URLRequest delegate:response] retain];
  
  
      [[NSNotificationCenter defaultCenter] postNotificationName:RKRequestSentNotification object:self userInfo:nil];
  }
  </code></pre>
  
  <p>I added one line before NSURLConnection init:</p>
  
  <pre><code>[_URLRequest setTimeoutInterval:1200];
  </code></pre>
  
  <p>But received timeout error again after 60 sec. RKResponse object is delegate for NSURLconnection. 
  So I found that after 60 sec delegate metod in RKResponce.m is called (even I try to init NSURLConnection object after [_URLRequest setTimeoutInterval:1200])  : </p>
  
  <pre><code>- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
      RKResponseIgnoreDelegateIfCancelled();
      _failureError = [error retain];
      NSLog(@"Error %@", error);
      [_request invalidateTimeoutTimer];
      [_request didFailLoadWithError:_failureError];
  }
  </code></pre>
  
  <p>Its strange for me that I can't make timeout for NSURLConnection more that 60 sec.</p>
  
  <p>Today i created new project to test this issue. I have this code: </p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      NSURL *url = [NSURL URLWithString: @"http://5.9.10.68:8182"];
      NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:url];
      [urlRequest setHTTPMethod:@"GET"];
      [urlRequest setTimeoutInterval:300.0];
      NSLog(@"timeout %f",urlRequest.timeoutInterval);
  
      NSURLConnection*  urlConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate: self];
  
  }
  - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
  
      NSLog(@"Error request %@", error);
  
  }
  </code></pre>
  
  <p>So here is the log:</p>
  
  <p>2012-07-17 14:37:58.627 f[76799:f803] timeout 300.000000<br>
  2012-07-17 14:39:14.488 f[76799:f803] Error request Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x687a690 {NSErrorFailingURLStringKey=http://5.9.10.68:8182/, NSErrorFailingURLKey=http://5.9.10.68:8182/, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x687a070 "The request timed out."}</p>
  
  <p>So timeout = 75, but not 300. Very strange.</p>