0

Requests don't seem to be sent when in 3G. The code is called and it returns to the callback with a -1001 error and the following message: "(The request timed out.)"

Protocol is HTTP, not HTTPs.

Code works fine in Wi-Fi.

Wireshark on the server does not show any incoming data when app is in 3G (but data is received when in Wi-Fi).

After network inspection in Instruments: request is shown but no data / packets out.

Code Below:

self.request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:self.route]];
[self.request setHTTPMethod:self.httpMethod];
self.request.timeoutInterval = XX.f;
[NSURLConnection sendAsynchronousRequest:self.request
                                   queue:queue
                       completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
                                              // Stuff actually getting called but with -1001 error code (only when NOT in Wi-Fi)
                                         }
aout
  • 300
  • 1
  • 2
  • 10
  • What is `timeoutInterval`. IS the cell service good, fast? – zaph Aug 22 '14 at 10:34
  • The timeoutInterval is 10.f right now but doesn't seem to affect the results. The cell service is pretty good, all others apps on the phone have no problem. – aout Aug 22 '14 at 10:35
  • I reopened this question because the (self) provided answer didn't work in the end. The problem seems random :( – aout Aug 26 '14 at 19:49
  • I'm having this issue right now. Were you able to figure it out? – KDaker Jun 03 '15 at 00:38
  • Yup, uninstall the app manually, reboot the phone the hard way (home + power) and it should work again. If it works you can upvote the answer below. – aout Jun 04 '15 at 13:32
  • Similar issue on one iPad (out of 40) that runs an enterprise app. Uninstall, reboot, reinstall did not fix it. Checking into it further now... – software evolved Jun 18 '15 at 19:20

2 Answers2

0

It seems that OSX 10.10 Beta can corrupt the network privileges of an app when installing from XCode.

The issue can be worked-around by completely uninstalling the app and rebooting the phone (pressing home and power button simultaneously).

aout
  • 300
  • 1
  • 2
  • 10
-1

The error code you get (-1001) resolves to NSURLErrorTimedOut, which means your request timed out. I recommend you check your firewall (at the server-end). Is your server accessible from your phone? Is port 80 accessible from your phone? Note that the IP address of your phone when you're using WiFi differs from the IP address you get using 3G.

cutsoy
  • 10,127
  • 4
  • 40
  • 57
  • As I said in the question, Wireshark shows no incoming activity on the server, which denies the possibility of a firewall blocking the requests. Also, since the code is exactly the same, the port should not be an issue. And yes the server is accessible from everywhere. – aout Aug 22 '14 at 13:39