保持RID与Strophe js连接的多个选项卡同步 [英] Keep RID in sync with multiple tabs for Strophe js connection

查看:339
本文介绍了保持RID与Strophe js连接的多个选项卡同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试实现一个聊天应用程序,其中我们使用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.

username@jabber.servername.com/tab1
username@jabber.servername.com/tab2

然后,您需要向每个资源,以使其保持最新的消息。请参阅: http://xmpp.org/extensions/xep-0280.html 。每个资源将有自己的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连接的多个选项卡同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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