在 3G 中似乎没有发送请求。代码被调用并返回到回调,并带有 -1001 错误和以下消息:“(请求超时。)”
协议是 HTTP,而不是 HTTP。
代码在 Wi-Fi 中运行良好。
当应用程序处于 3G 时,服务器上的 Wireshark 不显示任何传入数据(但在 Wi-Fi 时接收到数据)。
在 Instruments 中进行网络检查后:显示请求但没有数据/数据包输出。
下面的代码:
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)
}