Keep RID in sync with multiple tabs for Strophe js connection

◇◆丶佛笑我妖孽 提交于 2019-12-12 02:24:34

问题


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


回答1:


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

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.



来源:https://stackoverflow.com/questions/33451278/keep-rid-in-sync-with-multiple-tabs-for-strophe-js-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!