XMPP可以使用像彗星的HTTP漫长的等待?彗星、可以使用、漫长、XMPP

2023-09-10 16:44:05 作者:孤独即是自由

可以 XMPP 以类似的方式向被应用< A HREF =htt​​p://en.wikipedia.org/wiki/Reverse%5FAjax>反向阿贾克斯模式?它可用于实现HTTP漫长的等待如彗星?有没有使用这种技术与XMPP的例子吗?

Can XMPP be applied in a similar way to the reverse Ajax pattern? Can it be used to implement http long wait like Comet? Is there an example of using such a technique with XMPP?

推荐答案

是的。看看 XMPP通过BOSH 。这是一个长期存在的非轮询技术。从 BOSH规格:

Yes. Take a look at XMPP over BOSH. It's a long-lived non-polling technique. From the BOSH specification:

此规范定义了一个传输协议,它通过有效地使用多个同步HTTP请求/响应对模拟一个长寿命,双向的TCP两个实体(如客户端和服务器)之间的连接的语义,而不需要使用频繁轮询或分块的响应。

This specification defines a transport protocol that emulates the semantics of a long-lived, bidirectional TCP connection between two entities (such as a client and a server) by efficiently using multiple synchronous HTTP request/response pairs without requiring the use of frequent polling or chunked responses.

jbosh 是一个开源的Java实现。 Tigase.org 有许多项目,包括BOSH支持,似乎是主要的Java / GWT。 JAXMPP 是在框架的Java库,但目前还不清楚它所支持的功能设置。我没有尝试过任何这些我自己。

jbosh is an open source Java implementation. Tigase.org has a number of projects, including BOSH support, and appears to be mostly Java/GWT. JAXMPP is a Java library in the framework, although it's not clear what feature set it supports. I've not tried any of these myself.