Google Cloud Messaging - CCS (XMPP) 与 HTTP 服务器 [英] Google Cloud Messaging - CCS (XMPP) vs HTTP server

查看:24
本文介绍了Google Cloud Messaging - CCS (XMPP) 与 HTTP 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了文档https://developer.android.com/google/gcm/index.html

我能看到的唯一区别是基于 CCS (XMPP) 的服务器允许直接在 android 设备和 GCM 服务器之间进行双向通信.

and the only difference I can see is that a CCS (XMPP) based server allows bi-directional communication directly between an android device and the GCM server.

您会选择 CCS (XMPP) 而不是 HTTP 或反之亦然,还有其他原因吗?

Are there any other reasons why you would choose CCS (XMPP) over HTTP or vice versa?

推荐答案

CCS (XMPP) 是异步的,这意味着它应该比 HTTP 更快.它还使用设备上现有的 GCM 连接将消息从您的应用程序发送到您的服务器(这样可以节省电池,因为您不必打开自己的服务器连接).

CCS (XMPP) is asynchronous, which means it should be faster than HTTP. It also uses the existing GCM connection on the device to send messages from your app to your server (which saves battery, since you don't have to open your own connection to your server).

另一方面,HTTP 的编码要简单得多,因此除非您需要双向功能或需要以非常高的速度发送消息,否则我会坚持使用 HTTP.

On the other hand, HTTP is much simpler to code, so unless you need the bi-directional functionality or you need to send messages in a very high speed, I'd stick with HTTP.

这篇关于Google Cloud Messaging - CCS (XMPP) 与 HTTP 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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