Can XMPP be used like Comet's http long wait?

2019-04-08 04:53发布

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?

2条回答
做个烂人
2楼-- · 2019-04-08 05:28

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

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 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.

查看更多
可以哭但决不认输i
3楼-- · 2019-04-08 05:43
查看更多
登录 后发表回答