Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Who actually uses a full JID?

Tags:

xmpp

smack

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?

like image 670
Jacques René Mesrine Avatar asked May 12 '09 04:05

Jacques René Mesrine


3 Answers

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.

like image 77
bkreed Avatar answered Jan 02 '23 21:01

bkreed


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.

like image 42
Astro Avatar answered Jan 02 '23 19:01

Astro


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.

like image 26
andi5 Avatar answered Jan 02 '23 20:01

andi5