xcode purgeIdleCellConnections:找到一个清除 conn=0x1ddde360
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13193011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
purgeIdleCellConnections: found one to purge conn=0x1ddde360
提问by Abdu
I cannot find a proper solution to this problem. I think someone can help me to clear this bug.
我找不到解决此问题的适当方法。我想有人可以帮我清除这个错误。
Summary:When I use a 3G connection to test my app on the device, by the time the console shows this bug "purgeIdleCellConnections: found one to purge conn = 0x1ddde360"
more than one time, it occurs with different number (0x1ddde360 or 0x21b98a60 or....)
. Sometimes it hangs and the application crashes and dies. I cannot open the app. I have to delete and build again. When I use Wi-Fi it works fine: no problem at all.
总结:当我使用 3G 连接在设备上测试我的应用程序时,当控制台"purgeIdleCellConnections: found one to purge conn = 0x1ddde360"
多次显示此错误时,它以不同的数量出现(0x1ddde360 or 0x21b98a60 or....)
。有时它会挂起,应用程序崩溃并死亡。我无法打开应用程序。我必须删除并重新构建。当我使用 Wi-Fi 时,它工作正常:完全没问题。
Actual Results:I am using a web service(WSDL) in my app. While launching the application itself I am calling more than one web service. This app is already in the App Store (Promayarnlite) but that file was built using the IOS 5.1 SDK so it worked fine. Now I updated my Xcode to 4.5.1 and IOS 6 SDK, so I want to update my app in the App Store. I am struggling with this part.
实际结果:我在我的应用程序中使用了 Web 服务 (WSDL)。在启动应用程序本身时,我调用了多个 Web 服务。此应用程序已在 App Store (Promayarnlite) 中,但该文件是使用 IOS 5.1 SDK 构建的,因此运行良好。现在我将我的 Xcode 更新为 4.5.1 和 IOS 6 SDK,所以我想在 App Store 中更新我的应用程序。我在这部分苦苦挣扎。
EDIT: A: Internally NSURLConnection maintains a connection cache. Each cache entry represents a set of persistent HTTP connections to a host. When a new request comes in, it is queued on an entry in the cache. This may be an existing entry or it may be a new entry, and it may also generate a new HTTP connection within that entry, depending on various complex factors (the protection space, the authentication status [in the case of authentication methods--yes, I'm looking at you, NTLM!--that are stateful], pipelining, various cache limits, and so on). When a connection associated with a cache entry finishes running all of its requests, it looks for more work on the cache entry's queue; if it doesn't find any the connection goes idle. If the connection is idle for too long, the connection is purged (which closes the underlying TCP connection).
编辑:A:内部 NSURLConnection 维护连接缓存。每个缓存条目代表一组到主机的持久 HTTP 连接。当一个新请求进来时,它在缓存中的一个条目上排队。这可能是一个现有的条目,也可能是一个新的条目,它也可能在该条目内生成一个新的 HTTP 连接,这取决于各种复杂的因素(保护空间、身份验证状态 [在身份验证方法的情况下——是的,我在看着你,NTLM!--有状态的]、流水线、各种缓存限制等等)。当与缓存条目关联的连接完成其所有请求的运行时,它会在缓存条目的队列上寻找更多工作;如果没有找到任何连接空闲。如果连接空闲时间过长,
This cache implementation has changed in iOS 6. Prior to iOS 6 there was a single mechanism for purging idle cache entries, with radically different timeouts for Mac OS X and iOS (30 seconds versus 6 seconds, and the iOS value could be as low as 3 seconds on older versions of iOS). In iOS 6 there are now two mechanisms for purging idle cache entries, one that applies to connections running over WWAN and one that applies to all other connections. The WWAN timeout has dropped back to its traditional value (3 seconds) while the all-other-connections timeout has been bumped up to the old Mac OS X default (30 seconds).
此缓存实现在 iOS 6 中发生了变化。在 iOS 6 之前,有一种清除空闲缓存条目的机制,Mac OS X 和 iOS 的超时完全不同(30 秒与 6 秒,iOS 值可能低至在旧版本的 iOS 上为 3 秒)。在 iOS 6 中,现在有两种清除空闲缓存条目的机制,一种适用于通过 WWAN 运行的连接,另一种适用于所有其他连接。WWAN 超时已回落到其传统值(3 秒),而所有其他连接超时已提高到旧的 Mac OS X 默认值(30 秒)。
The log message you're seeing is generated when a WWAN connection is purged. This log message didn't exist in iOS 5.x, which explains why you're not seeing it in your tests. However the basic mechanism has been present, in one form or another, on all versions of iOS.
您看到的日志消息是在清除 WWAN 连接时生成的。此日志消息在 iOS 5.x 中不存在,这解释了为什么您在测试中看不到它。然而,基本机制已经以一种或另一种形式存在于所有版本的 iOS 上。
This message is more likely to be a symptom than a cause. Specifically the message only applies to idle connections; this is just NSURLConnection cleaning up persistent HTTP connections that aren't doing anything useful. If you're having problems with your networking you need to investigate why the connections are going idle.
此消息更可能是症状而非原因。具体来说,该消息仅适用于空闲连接;这只是 NSURLConnection 清理没有做任何有用的持久 HTTP 连接。如果您的网络出现问题,您需要调查连接空闲的原因。
回答by JOM
Seen this on device running iOS 6.0.1(iPhone 3GS), when using AdMob Mediation SDK. Application itself does 100+ connection to server (next server API will fix that issue), but these console log messages started appearing only after AdMob connections got active. Both 3G and Wifi (10M connection).
使用 AdMob 中介 SDK 时,在运行 iOS 6.0.1(iPhone 3GS) 的设备上看到了这一点。应用程序本身与服务器建立了 100 多个连接(下一个服务器 API 将解决该问题),但这些控制台日志消息仅在 AdMob 连接激活后才开始出现。3G 和 Wifi(10M 连接)。
Best guess is that iOS is not happy getting network calls from two different networking libraries- AdMob in this case, but I guess it could be anything. Just a coincident.
最好的猜测是,iOS 不乐意从两个不同的网络库(在本例中为 AdMob)获取网络调用,但我想它可以是任何东西。只是巧合。
Sometimes app gets totally stuck, sometimes there's no visible problems. Would love to fix this, but so far haven't found anything...
有时应用程序完全卡住,有时没有明显的问题。很想解决这个问题,但到目前为止还没有找到任何东西......
回答by Maverick
When on the device connected to cellular network, I have observed this debug message coming out of the iOS 6.0 SDK. Timing-wise I find it correlates to 'active' AJAX calls being terminated in my app. However it is very difficult to prove anything since this only occurs when rendering the web page in a UIWebView. I am just saying I don't think the messages are benign. I think they might indicate a bug in the Apple framework that is overly aggressive in terminating connections. It is hard to get instrumentation on the javascript running inside the UIWebView that makes the AJAX calls, so it is all highly speculative at this time.
在连接到蜂窝网络的设备上时,我观察到此调试消息来自 iOS 6.0 SDK。在时间方面,我发现它与在我的应用程序中终止的“活动”AJAX 调用相关。然而,很难证明任何事情,因为这只会在 UIWebView 中呈现网页时发生。我只是说我不认为这些消息是良性的。我认为它们可能表明 Apple 框架中存在一个错误,该错误在终止连接方面过于激进。很难对在 UIWebView 中运行的 javascript 进行检测以进行 AJAX 调用,因此此时它是高度推测性的。