简体   繁体   English

NSURLErrorDomain代码= -1005“网络连接丢失。”,_ kCFStreamErrorCodeKey = 54

[英]NSURLErrorDomain Code=-1005 “The network connection was lost.”, _kCFStreamErrorCodeKey=54

Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." Domain = NSURLErrorDomain Code = -1005“网络连接丢失。” UserInfo={_kCFStreamErrorCodeKey=54, NSUnderlyingError=0x2834c47b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=54, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask .<1>" ), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey= https://xxx.xxxx.com/xxxx/xxxxx , NSErrorFailingURLKey= https://xxx.xxxx.com/xxx/xxx , _kCFStreamErrorDomainKey=1} [-1005] UserInfo = {_ kCFStreamErrorCodeKey = 54,NSUnderlyingError = 0x2834c47b0 {Error Domain = kCFErrorDomainCFNetwork Code = -1005“(null)”UserInfo = {_ kCFStreamErrorCodeKey = 54,_kCFStreamErrorDomainKey = 1}},_ NSURLErrorFailingURLSessionTaskErrorKey = LocalDataTask。<1>,_ NSURLErrorRelatedURLSessionTaskErrorKey =(“LocalDataTask 。<1>“),NSLocalizedDescription =网络连接丢失。,NSErrorFailingURLStringKey = https://xxx.xxxx.com/xxxx/xxxxx,NSErrorFailingURLKey = https://xxx.xxxx.com/xxx/xxx,_kCFStreamErrorDomainKey = 1} [-1005]

Got above error When I am firing api using AFNetworking. 得到以上错误当我使用AFNetworking触发api时。 I have configured "App Transport Security setting" to allow arbitrary loads. 我已配置“应用程序传输安全设置”以允许任意加载。 Increased timeout interval of AFNetworking request serializer to 100 seconds. 将AFNetworking请求序列化程序的超时间隔增加到100秒。 But none helped. 但没有人帮助。

If you are testing on simulator you might face this issue. 如果您在模拟器上进行测试,则可能会遇到此问题。 I guess the simulator internally may not able to connect to the internet, so that is why it was not able to connect to the server. 我想内部的模拟器可能无法连接到互联网,所以这就是它无法连接到服务器的原因。 Try restarting the simulator and check .If it still doesn't work correctly then clear all the content and data for simulator from Hardware --> Erase All Content and Settings. 尝试重新启动模拟器并检查。如果它仍然无法正常工作,则从硬件 - >清除所有内容和设置清除模拟器的所有内容和数据。

If you are checking in the real device please check the internet connection of the device. 如果您正在检查真实设备,请检查设备的互联网连接。

If the internet connection is working fine then there is some configuration to be done at server end with 'Keep-Alive' value in configuration. 如果互联网连接工作正常,那么在服务器端有一些配置需要配置中的“保持活动”值。 I found the same solution at multiple references as below : 我在多个参考文献中找到了相同的解决方案如下:

https://github.com/AFNetworking/AFNetworking/issues/2801 https://github.com/AFNetworking/AFNetworking/issues/2801

Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." 错误域= NSURLErrorDomain代码= -1005“网络连接丢失。”

Hope this helps. 希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 名为“ NSURLErrorDomain代码= -1005”的网络连接丢失。 - Network error named “NSURLErrorDomain Code=-1005 ”The network connection was lost." comes too frequently 在移动网络上解析iOS SDK错误域= NSURLErrorDomain代码= -1005“网络连接丢失。” - Parse iOS SDK Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” on mobile network 为什么NSURLConnection失败,错误域= NSURLErrorDomain Code = -1005“网络连接丢失。”在Swift iOS8中? - Why NSURLConnection failed with Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” in Swift iOS8? Error Domain = NSURLErrorDomain代码= -1005“网络连接丢失。”-在iOS 9中使用https - Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” - Occurs in iOS 9 with https 无法确定当前的国家/地区代码:错误域= NSURLErrorDomain代码= -1005“网络连接丢失。” - Could not determine current country code: Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” 随机获取Error Domain = NSURLErrorDomain代码= -1005“网络连接丢失。” - Randomly getting Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” NSURLErrorDomain代码= -1005“网络连接丢失 - NSURLErrorDomain Code=-1005 "The network connection was lost 网络连接丢失。NSURLErrorDomain代码= -1005 - The network connection was lost.NSURLErrorDomain Code=-1005 Alamofire请求错误:NSURLErrorDomain代码-1005网络连接丢失 - Alamofire Request error: NSURLErrorDomain Code -1005 The network connection was lost Error Domain = NSURLErrorDomain代码= -1005“网络连接丢失 - Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM