Note that there are some explanatory texts on larger screens.

plurals
  1. PORestKit Timeout Being ignored
    text
    copied!<p>I am calling a webservice from my iOS app which can take up to four minutes to return. I am using RestKit for the call and loading of the objects. What I'm finding is that when the requests are taking a long time, I get a Timeout error after ~60 seconds. I have tried setting the timeoutInterval to absurd amounts but it still times out after ~60. </p> <pre><code>RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:HOSTNAME]; objectManager.client.requestQueue.showsNetworkActivityIndicatorWhenBusy = YES; objectManager.client.disableCertificateValidation = YES; //timeout objectManager.client.timeoutInterval = 1000; </code></pre> <p>Here is the call to the service:</p> <pre><code>- (void)loadData { NSString *uid = [self retrieveFromUserDefaults:@"login_preference"]; NSString *pwd = [self retrieveFromUserDefaults:@"password_preference"]; if([uid isEqualToString:@""] || [pwd isEqualToString:@""]){ [self stopSpinner]; [self enableUserInterface:YES]; UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Missing Settings" message:@"Please enter your login information in the settings." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; return; } RKObjectManager* objectManager = [RKObjectManager sharedManager]; NSDictionary *params = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects:uid, pwd, nil] forKeys:[NSArray arrayWithObjects:@"uid", @"pwd", nil]]; // Load the object model via RestKit [objectManager loadObjectsAtResourcePath:[@"/synchData" appendQueryParams:params] delegate:self]; </code></pre> <p>}</p> <p>I'm doing the call to the webservice in a background thread - is there something in that design that could be causing the problem? I can't imagine what, like iOS not letting background threads run for longer than 60 seconds? I just can't figure out what is the problem. </p> <p>Is the timeout the time it takes to get a response from the server, or to get the WHOLE response from the server? I am returning a potentially very large json response - do I need to return the whole thing within the timeout limit, or do I just need to get any response from the server within the limit? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload