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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With