NSURLErrorDomain Code=-1005. The network connection was lost. In LTE only, works with WiFi

Here is the code I am using:


  NSString *dataUrlString = [NSString stringWithFormat:@"https://some_valid_server_name"];
    NSURL *url = [NSURL URLWithString:dataUrlString];

    NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
    NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
    request.HTTPMethod = @"POST";
    NSURLSessionUploadTask *uploadTask = [session uploadTaskWithRequest:request
                                                              fromData:someData
                                                      completionHandler:^(NSData *data,NSURLResponse *response,NSError *error) {
                                                          if (error != nil)
                                                              NSLog(@"ERROR %@", error);
                                                              }];
    [uploadTask resume];


This works fine with WiFi. If I switch to LTE, it fails with:

NSURLErrorDomain Code=-1005. The network connection was lost.

Checked the server logs. The request doesn't even reach the server (Apache 2.4). Other sites are reachable with LTE. But my server is not reachable in Safari either. But it does work with Wifi. Any ideas/suggestions?

Are you are brycesteve working together on this? I got in this morning and found no less than five threads all related to the same subject:

I will respond on the first one.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Are you are brycesteve working together on this? I got in this morning and found no less than five threads all related to the same subject:

I will respond on the first one.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I may have posted multiple times since I didnt see it in the forum immediately after posting.


My apologies. The 1005 error was a user error on my part. The server was on a net where the firewall rule blocked inbound access from unknown outside networks (which is the case when you connect via LTE). So it is all good now.


BTW, I have no idea who brycesteve is.

NSURLErrorDomain Code=-1005. The network connection was lost. In LTE only, works with WiFi
 
 
Q