Resources and Priorities

In the previous section, we saw how the resource is used to “qualify” certain queries to a servername, to hold information such as version numbers, and to represent users in a conference room. However, the resource is traditionally seen as a way of making a distinction between simultaneous connections by a user to the same Jabber server. For example, if you connect to a Jabber server using the same username and password on three different machines (or resources), the Jabber server will look at the resource part of the JID to determine which client to route messages to.

For the purpose of this example, let’s say that the three resources are a workstation, a laptop, and a PDA. Each client is connected to the same Jabber server, so the resource part of the JID can be used to distinguish between the three connections. They could also be used to differentiate between the three connections coming from the same client host.

The classic explanation serves us well here: In a work situation, I might be connected to my Jabber server using a client on my workstation. I might also be connected, with the same username, to my Jabber server on my laptop that’s sitting next to my workstation. Furthermore, I might have a handheld device that runs a small Jabber client that I’m connected with, too.

On each client machine, I’m connecting using the same credentials (username and password) to the same Jabber server. So the resource part of a JID can be used to distinguish ...

Get Programming Jabber now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.