admin管理员组文章数量:1654293
ID as the unique identifier of the message is generated by the client . The client uses it to keep track of the message.
SessionID generated by the server is used to identify the client and keep the correct session with the client.
Every time the client sends message which uses different id to the server. And the server responses with the same id. But how does the server identify the different clients when many client connect to the server simultaneously. Furthermore, how does the client distinguish from the messages from the other clients who are chatting at the same time. It is easily to be at a loss and confused.
To resolve the first question: When the client connects to the server, the server will create a session ID associated with the jabber id. So the session id bind with the jabber id which can the the identifier to identify the clients for the server. When the server want to send message the the specific client, it can write the XML stream to the right recipient according to the session id.
To resolve the second question: The Jabber protocol use the subelement <thread/> to help. As you know, if the client wants to chat with many other client simultaneously, each conversation will need a thread to maintain. the <thread/> can be the identifier to the moment.
Each process of identifying run at respective process.
本文标签: identify
版权声明:本文标题:Identify 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1729650824a1209018.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论