0

I am trying to set the request timeout as 120 for the NSMutableURLRequest, but it is ignoring. The request timout fails within 90 secs. Can any one tell me how to set the request timeout for the NSMutableURLRequest ?? . I have gone through some links stating that about the default timeout value as 240 secs. I can't find any apple document describing about that . Can anyone help me ?

NSMutableURLRequest* urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:serverURL]];

[urlRequest setHTTPMethod:@"GET"];
[urlRequest setTimeoutInterval:120];

_urlConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate: self];
Perseus
  • 1,546
  • 4
  • 30
  • 55

1 Answers1

1

It is true. minimum is 240 sec. set below that will be ignored.

why don't you find alternative instead of finding the prof.

You can use ASIHTTPRequest. you may set setTimeOutSeconds: & setNumberOfTimesToRetryOnTimeout: as you want. Note: developers has stop maintaining this project, but it's stable for now. for IOS 5.x or above, you may look other alternative.

HelmiB
  • 12,303
  • 5
  • 41
  • 68
  • I am trying to develop for iOS 5.x and above. I have edited and pasted the code which i am trying right now – Perseus May 02 '12 at 12:27
  • ASIHTTPRequest authors well written and amusing post on why he is EOL'ing: – np0x May 03 '12 at 04:24