错误:__tcp_connection_write_eof_block_invoke写closurescallback收到错误 – iOS 10
发送XML基本API请求到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 API发布请求:
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];
另外阅读苹果表格 ,但没有得到解决scheme。
试试这个代码:
我有同样的问题,但有一些你可以做的,
1)进入产品 – >计划 – >编辑计划
2)运行左边的部分,select参数选项卡,并在环境variables把这个。
OS_ACTIVITY_MODE值:禁用。
欲了解更多信息,请查看下面的截图。
这将消除控制台中的消息。
但我仍然与PLBuildVersion
斗争是在两个实施….
我希望这可以帮助你 !
- 比较NSCollectionView和UICollectionView#1
- 在iOS上,我的应用程序如何获取手机在后台收到的通知数据?
- 解析Apple Mach O-Linker错误?
- xcode 7.1 swift框架应用程序构build但不归档
- iOS Swift。 如何从一个UIImage(NSURL)获取GPS元数据?
- 如何为iOS创build新的自定义情感键盘(有点像表情符号)
- iPhone应用程序在WebThread MPVolumeSlider上崩溃
- 如何findIOS 5以上的最前面的应用程序的紫色端口?
- 使用UIImageRenderingModeAlwaysTemplate从界面生成器中淡入UIButton的图像