Android GCM消息需要很长时间 [英] Android GCM messages take too long to come

查看:143
本文介绍了Android GCM消息需要很长时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我大部分时间都会马上收到邮件,但有时邮件会在5几分钟之后,就像他们被困在路上一样。这是正常的吗?

解决方案

客户端手机上的GCM框架部分使用 TCP连接端口5228.该连接用于推送通知,但作为每个tcp连接,它可以与一些应用严格策略来终止非活动tcp连接( tcp idle timeout )的路由器/运营商超时。 p>

大多数wifi路由器在5分钟后杀死不活动的连接,例如我的。



GCM框架使用 keep-alive 机制每15分钟在wifi上发送心跳网络数据包,在3G上每28分钟发送一次心跳网络数据包。对于所有用户而言,这种保持活力并不总是可靠的。



我在此处向Google打开了此问题:
https://productforums.google.com/forum/#!category-topic/nexus/connecting-to -networks-and-devices / fslYqYrULto
他们同意目前存在问题。


I work with GCM in my application, and I have a problem.

Most of the time I get the messages right away, but sometimes the messages come after 5 minutes, one after another, like they got stuck on the way. Is this normal?

解决方案

The GCM framework part on the client phone use a TCP connection on the port 5228. This connection its used for push notifications, but as every tcp connection it can go on timeout with some routers/carriers that apply strict policies to kill inactive tcp connections (tcp idle timeout).

Most wifi routers kills inactive connections after 5 minutes for example, like mine.

The GCM framework use a keep-alive mechanism to send an heartbeat network packet every 15 minutes on wifi and every 28 minutes on 3G. This keep-alive is not always reliable for all users.

I opened the issue to google here: https://productforums.google.com/forum/#!category-topic/nexus/connecting-to-networks-and-devices/fslYqYrULto They agree there is currently an issue.

这篇关于Android GCM消息需要很长时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆