Difference between revisions of "XMPP Resources"

From XMPP WIKI
Jump to navigation Jump to search
m (Removed link pointing to a parked domain)
 
m (Neustradamus moved page Jabber Resources to XMPP Resources)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
In Jabber you are able to log in several client programs simultaneously. You don't need to have different Jabber accounts for work and for home. You can chat at home, then go to work, log in again with the same JID and your home Jabber client will not go offline after that.
In XMPP, you are able to log in several client programs simultaneously. You don't need to have different XMPP accounts for work and for home. You can chat at home, then go to work, log in again with the same JID and your home XMPP client will not go offline after that. This is because XMPP Accounts (JIDs) have a component called the "resource part" which allows multiple clients to share the same bare JID (as long as they have unique resource parts).


This is because Jabber has a thing named resources. When you log in, you are usually asked for for
Resources allow individual clients to be addressable on the network, this way the server can send messages to all of your online clients or address a particular client (for instance, to send a file only to your phone).
the Resource Name. For example, you could have a resource "Home" at your home Jabber client and "Work" at you work client. Some programs like to use their names as a resource name, for example: "iChat", "GAIM".
Specifying a fixed resource like "Home" or "Work" is generally discouraged because of security concerns. Because servers may also override resources with random routing data, if you must display individual clients to the user (for example, to ask if they want to send a file to a friends phone or laptop), information about the device type from XEP-0030: Service Discovery or software version information from XEP-0092: Software Version should be displayed instead. See also [[XMPP_IM_Client_Design_Guidelines#Do_not_to_encode_any_semantics_into_the_resource.2C_let_the_server_generate_a_resource_for_you|this page]].


When other people look at "you" in their rosters, they usually see a list of resources you are available through. They could send a message to your particular resource, using these JIDs: ''you@jabber.org/Home'' or ''you@jabber.org/Work''. You could even log in twice at the same computer through different Jabber clients and chat between different incarnations of yourself!
{{Technical Page}}
 
But when Romeo sends a message to Juliet using her usual JID ''juliet@capulet.com'', how she will actually receive a message - through ''juliet@capulet.com/balcony'' or through ''juliet@capulet.com/bedroom''?
 
User can set different priorities for his/her resources. A priority of resource shows user's availability through this resource. When you are at home, you have "Available" status in your home Jabber client and high priority for it. When you are at work, your home Jabber client probably have status "Extended away" and low priority, while your work client is "Available". So all messages for you are coming to your work client.
 
=Example=
 
Let's imagine you working at your office. At 2:00 PM you decide to go to lunch. You lock your computer causing your Jabber client to fall into "Away" status. But on your way to a restaurant you could start small J2ME Jabber application at your cellphone (for example, [http://mobber.gryf.info/ mobber]). So now you are "Available" again, and all messages will be delivered to your phone while you are out of the office. You come to a restaurant and make an order. Wow, there is a free Wi-Fi service at the restaurant! So you load your PDA and connect. One more of your Jabber client starts, and now you already have at least three available resources at your resource list: "work" (office PC), "cellphone" and "pda". Both "cellphone" and "pda" have "Available" status. You probably prefer chatting through PDA because it has larger screen, easier
text input and free Wi-Fi access. So PDA should have higher priority than cellphone for the same status.
 
Most Jabber clients allow you to tune priority values for every status. Cellphone clients often have predefined priority values that are lower than usual. Check some Additional Settings at your Jabber client!

Latest revision as of 01:07, 17 December 2020

In XMPP, you are able to log in several client programs simultaneously. You don't need to have different XMPP accounts for work and for home. You can chat at home, then go to work, log in again with the same JID and your home XMPP client will not go offline after that. This is because XMPP Accounts (JIDs) have a component called the "resource part" which allows multiple clients to share the same bare JID (as long as they have unique resource parts).

Resources allow individual clients to be addressable on the network, this way the server can send messages to all of your online clients or address a particular client (for instance, to send a file only to your phone). Specifying a fixed resource like "Home" or "Work" is generally discouraged because of security concerns. Because servers may also override resources with random routing data, if you must display individual clients to the user (for example, to ask if they want to send a file to a friends phone or laptop), information about the device type from XEP-0030: Service Discovery or software version information from XEP-0092: Software Version should be displayed instead. See also this page.

Template:Technical Page