使用 XMPP 与移动应用程序进行频繁通信

发布于 2024-12-12 18:05:20 字数 482 浏览 0 评论 0原文

我正在开发的移动应用程序要求服务器在短时间内频繁地与其通信,包括应用程序要显示的实时(或非常接近)的内容(来自其他用户)。

它将是一个 iOS 和 Android 应用程序。

我正在研究 C2DM 并在此页面上 http://code.google.com/android/c2dm /quotas.html,在底部建议考虑“实现 XMPP 或您自己的协议来交换消息”。

我想要在服务器和应用程序之间进行通信的内容不容易落入 XMPP 的常用聊天列表中,您将如何实际实现它?

是否会为服务器和移动应用程序语言选择适当的 XMPP 库,然后制作自定义服务器(和客户端)?这不会耗尽手机电池吗?可以通过 RESTful 架构来完成吗?

(如果有帮助的话,目前没有为服务器做出任何决定 - 除了它必须具有高度可扩展性)。

A mobile app I'm working on requires the server to communicate with it frequently over a short period of time, including real-time (or very close) things for the app to show (from other users).

It will be an iOS and Android app.

I was researching C2DM and on this page http://code.google.com/android/c2dm/quotas.html, at the bottom it recommends considering "implementing XMPP or your own protocol to exchange messages".

What I want to communicate between the server and the app does not fall easily into XMPP's usual chat roll, how would you go about actually implementing it?

Would it be a case of choosing appropriate XMPP libraries for the server and mobile app languages, then making a custom server (and client side)? Wouldn't this drain the battery on the phone? Can it be done over a RESTful architecture?

(If it helps, there are currently no decisions made for the server - other than it has to be highly scalable).

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

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

发布评论

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

评论(1

幻梦 2024-12-19 18:05:20

如果您想要通信的内容可以轻松地表示为 XML 并且不太大,那么可以通过 XMPP 轻松完成。 XMPP 具有很强的可扩展性。您将必须编写客户端(这是预期的)并使用许多可用服务器之一。服务器上的定制通常意味着编写一个组件(通用且受规范支持)或某种插件(这将是特定于服务器的),但如果没有更多信息,我无法告诉您是否需要这样做。

它的用途不仅仅是聊天应用程序,尽管这是最常见的用途。几乎可以处理任何基于文本的即时消息(以及其他)。有大量的基础协议的扩展来支持各种功能。

If what you want to communicate can be easily represented as XML and is not too large, then it can be easily done via XMPP. XMPP is very extensible. You will have to write the client side (to be expected) and use one of many available servers. Customization on the server usually means writing a component (generic and supported by the spec) or some sort of plugin (this will be server specific), but without more information I couldn't tell you if that would be required or not.

It is used for much more than just chat apps, although that would be the most common usage. Pretty much any text based instant messaging can be handled (as well as others). There are a huge number of extensions to the base protocol to support a wide variety of functionality.

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