Android 和 Google App Engine 之间的请求间歇性丢失
有人使用 Java URLConnections 将 GET 请求从 Android 应用发送到 Google App Engine 上托管的 Python 脚本吗?我看到很少有用户报告 IOExceptions,并且相应的请求在 GAE 中未记录。我想这意味着他们的网络连接断开了,但我想知道是否有人有这里的经验。
了解 GAE 有一些假脱机时间,但我认为该请求至少会在延迟导致问题之前被记录下来。我感觉我可能在这里遗漏了一些东西......
编辑:我写了一个非常模糊的问题,所以我道歉。我现在相信我的问题与 GAE 没有任何关系。我的问题是:在 Android 应用程序中使用 URLConnection 时,最佳做法是在发送请求之前检查网络连接、捕获 IOException 并重新触发请求一定次数还是其他操作?
干杯,瑞安
Anyone using Java URLConnections to send GET requests from your Android app to a Python script hosted on Google App Engine? I'm seeing rare user reports of IOExceptions and the corresponding requests are going unlogged in GAE. I suppose this means their network connection dropped but I'm wondering if anyone has experience here.
Understand GAE has some spool up time but I thought the request would at least get logged before the latency causes problems. I get the feeling I might be missing something here...
EDIT: I wrote a pretty vague question so I apologize. I now believe my issue doesn't has anything to do with GAE in particular. My question is: when using URLConnection in an Android app, is it best practice to check for a network connection before sending the request, catch IOExceptions and re-fire the request a certain number of times, or something else?
Cheers, Ryan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我非常确定,如果它没有出现在日志中,很可能它根本没有到达 GAE。
我确实看到 GAE (Java) 上的中途连接被丢弃,但对于这些 - 首先建立连接,然后由 Android 丢弃。
I'm pretty sure that if it does not appear in the log, most probably it does not get to GAE at all.
I do see half-way connections getting dropped on GAE (Java), but with these - connection is first made, and then dropped by Android.