同时向ONVIF摄像机发送请求。它在ios 9设备上运行良好,但在iOS 10上却产生了“500个内部错误”。
XCode 8控制台在错误消息下面打印:
2016-09-30 12:39:51.295419 VCPlugin[278:10183] [] nw_socket_get_input_frames recvmsg(fd 12, 1024 bytes): [54] Connection reset by peer
2016-09-30 12:39:51.301221 VCPlugin[278:10228] [] nw_socket_write_close shutdown(12, SHUT_WR): [57] Socket is not connected
2016-09-30 12:39:51.301307 VCPlugin[278:10228] [] nw_endpoint_flow_service_writes [3 10.107.2.153:80 ready socket-flow (satisfied)] Write request has 0 frame count, 0 byte count
2016-09-30 12:39:51.301903 VCPlugin[278:10185] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [89] Operation canceled
2016-09-30 12:41:13.492053 VCPlugin[278:10287] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [57] Socket is not connected
2016-09-30 12:42:51.278617 VCPlugin[278:10228] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument如果用户重试并重试三到四次,那么在从服务器获得有效的xml响应之后。
我不知道iOS 10的这种行为。
这是我为调用XML请求编写的代码:
NSMutableURLRequest * urlRequest = [NSMutableURLRequest requestWithURL:url];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setHTTPBody:body];
[urlRequest setValue: @"application/soap+xml" forHTTPHeaderField:@"Content-Type"];
[urlRequest setValue: @"application/soap+xml" forHTTPHeaderField:@"Accept"];
NSURLSessionDataTask * dataTask = [defaultSession dataTaskWithRequest:urlRequest completionHandler:^(NSData *data1, NSURLResponse *response, NSError *error) {
NSLog(@"Response:%@ %@\n", response, error);
if(error == nil)
{
NSString * text = [[NSString alloc] initWithData: data1 encoding: NSUTF8StringEncoding];
NSLog(@"Data = %@",text);
}
}];
[dataTask resume];还阅读苹果形态,但没有得到解决方案。
发布于 2016-09-30 12:45:33
试试下面的代码:
我也有同样的问题,但你可以做点什么,
1)进入产品->方案->编辑方案
2)在左侧运行区段,选择参数选项卡,在环境变量中放置此选项卡。
OS_ACTIVITY_MODE的值:禁用。
欲知更多信息,请找到下面的截图。

这将消除控制台中的消息。
但我仍然挣扎于PLBuildVersion是在两个.
希望这对你有帮助!
https://stackoverflow.com/questions/39791692
复制相似问题