问题描述
我们正在尝试实现一个聊天应用程序,其中我们使用strophe js进行http绑定。一切工作正常,我们面临的唯一的问题是保持连接与多个选项卡。我没有得到如何保持RID同步时多个选项卡打开。请帮助!!
We are trying to implement a chat application where we are using strophe js for http-bind. Everything works fine, the only problem we are facing is with keeping connection alive with multiple tabs. I am not getting how to keep RID in sync when multiple tabs are open. Please help!!
推荐答案
每个请求资源都应该有自己的资源名称。在您的实例中,每个标签应该有自己的资源名称和连接。
Each requesting resource should have it's own resource name. In your instance, each tab should have it's own resource name and connection.
[email protected]/tab1
[email protected]/tab2
然后,您需要向每个资源,以使其保持最新的消息。请参阅:。每个资源将有自己的RID。
You will then need to cc any messages to each resource to keep them up to date with messages. See: http://xmpp.org/extensions/xep-0280.html. Each resource will then have it's own RID.
这篇关于保持RID与Strophe js连接的多个选项卡同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!