Who actually uses a full JID?

心不动则不痛 提交于 2019-12-10 04:32:26

问题


When logging in to an XMPP server via smack, I only send the userid/password combination.

Do server components actually use the "resource" parameter in a full JID?

e.g. ali@someplace/resource

What are the benefits of sending it?


回答1:


Resources are useful if you have multiple clients logged in.

For example, if I'm logged in at home and at work using a different resource for each connection, then I can have my presence set for each. Maybe I'm at home so work is set xa and home is set to chat.

Resources can really be useful when you've got heterogeneous clients and you can use capabilities (XEP-0115) to distinguish the features the clients can use.




回答2:


XMPP has 3 types of stanzas: message, presence and iq. Only message and presence to a bare JID will get routed to a client. iq stanzas with bare JIDs will be handled by the server.




回答3:


I think for most of the jabber users, the main advantage is set different presences for different clients connected at the same time. Combine this with a priority child of the presence stanza, you can control where undirected (to="user@server") messages (read: message stanzas!) will go to. Your server will pick the one client with the highest priority if there is one, if there is more than one the actual behavior is unspecified I think. And, messages will only be delivered if the priority of the client chosen is non-negative.



来源:https://stackoverflow.com/questions/851156/who-actually-uses-a-full-jid

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