Home > Articles

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Protocol Details

In the very crude client constructed earlier we used all the client-to-server elements and demonstrated a large percentage of the simple things a client can do. Let's look in greater detail at the elements we used so that when you write some more sophisticated clients, you will understand what elements are important with what messages.

The <stream:stream> Tag

Let's start with the <stream> tag. As we said earlier, this tag has as potential elements everything in the conversational stream. Additionally, as you may have noticed, it also has some attributes.

First of all, the tag identifier has a kind of funny notation, stream:stream. This basically says that this is a stream tag of the type defined and qualified by the namespace stream, whose definition can be found at the URI http://etherx.jabber.org/streams. The little piece of required encoding in the tag that reads xmlns:stream='http://etherx.jabber.org/streams says precisely that. Notice that it is required to be in the tag exactly as encoded.

The to Attribute

This attribute specifies the virtual host within the Jabber server. Multiple <host/> entries are allowed in the jabber.xml configuration file—each one is for a separate virtual server. It might be that if you're planning a relatively big farm of jabberd servers, that you start out by specifying them on the same physical hosts, then when it runs out of gas, move each virtual server to a separate physical server in the future. The to attribute in a <Stream:stream> tag therefore refers to the virtual server for your particular client. Jabber servers can of course resolve names to DNS addresses for other Jabber servers, so you can spread servers over hosts as load growth demands.

  • + Share This
  • 🔖 Save To Your Account