克服 RestKit 中 RKReachabilityObserver 的问题

发布于 2024-12-26 12:40:11 字数 750 浏览 0 评论 0原文

我最近发布了关于实现 RKReachabilityObserver 的最佳方式RestKit 项目)在我的 iOS 项目中。

mja 善意地告诉我,有一个可用的单例,我在应用程序的各个点上实现了它。我将 kBaseUrl 设置为 IP 地址以避免 DNS 问题,并测试了以下结果:

  • 如果 IP 可访问并且设备有接收,则观察器按预期工作,延迟最小。
  • 如果 3G 信号可用但无法访问服务(如果您使用 英国沃达丰),观察者需要很长时间才能报告其结果,并且偶尔根本没有反应。
  • 当使用 WiFi 且网络繁忙/拥塞时,会出现与上述相同的行为。

我可以做些什么来提高 RKReachabilityObserver 的可靠性吗?也许可以通过替代实现?

I posted recently about the best way to implement RKReachabilityObserver (part of the RestKit project) in my iOS project.

mja kindly informed me that there was a singleton available which I implemented at various points in my application. I set the kBaseUrl to an IP address to avoid DNS issues and tested with the following results:

  • If the IP is reachable and the device has reception, the observer works as expected with only minimal delay.
  • If 3G signal is available but the service can't be reached (happens a lot if you're on Vodafone in the UK), the observer takes a very long time to report its result and occasionally doesn't respond at all.
  • When on WiFi and the network is busy/congested, the same behaviour as above is noted.

Is there anything I can do to improve the reliability of the RKReachabilityObserver from my end, perhaps via an alternative implementation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铁轨上的流浪者 2025-01-02 12:40:11

您始终可以尝试使用 Reachability Apple 的示例。该类提供了 getter 和通知机制来确定和观察设备可达性状态的变化。

至于 RKReachabilityObserver,我认为仍在进行改进操作的工作。您能指出您的设备运行的是哪个 iOS 版本吗?

You can always try to use the Reachability example by Apple. The class provides both getter and notification mechanism to determine and observe the changes in device's reachability status.

As for the RKReachabilityObserver, i think there is still work underway to enhance the operation. Can you indicate which iOS version do you run on the device?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文