All About Jabber Clients
- What Is a Jabber Client?
- Session Mechanics
- Protocol Mechanics
- Protocol Details
- The <iq> Element
- Summary
A client is to me a mere unit, a factor in a problem.
Sherlock Holmes
You can learn a lot from the client. Some 70% doesn't matter, but
that 30% will kill you."
Paul J Paulson, former President, Doyle Dane Bernbach
This chapter looks at the other side of the conversation: the clientthe reason that a server exists in the first place. In the second quote, the president of the once powerful DDB&O Advertising Agency seems to be saying that there's some absolute minimum that you must implement in a relationship with (human) advertising clients. In contrast, there is no minimum that you need to implement for a successful Jabber client. The Jabber client can be pretty simpleanything that correctly responds to some (or all) of the set of XML-based Jabber messages. It can be pretty complex, as are the GUI clients that are commonly available. No rule says how much of the entire Jabber protocol a client must implement.
Implement exactly as much as you need to provide the functionality of your application, and ignore (gracefully) the rest. For example, the XML-RPC tunnel shown in Chapter 7, "Jabber and Web Services," doesn't implement any message support, nor does it respond to any presence messages. It expects only <iq> (infoquery) messages containing XML-RPC requests and responses, transported for clients that are not actually Jabber clients. The picture sharing application shown later in this chapter is a Jabber client that responds to all three types of Jabber messages, but which renders message payloads in a special way.
Finally, what's exciting about Jabber is that you can implement elements of your client in any language that pleases youJabber delivers on its promise to be language and platform neutral.
This chapter gives you some rudimentary Jabber clients to build; these will help you understand that creating a client is really a pretty easy exercise. Then it presents a comprehensive reference to the types of messages your client might expect to handle. Finally, it explores the various stanzas of XML used in Jabber messaging.
What Is a Jabber Client?
A design goal for Jabber was that it support a simple messaging structure and allow clients ranging from full function GUIs and special applications, down to the trivially simple (for example, even something as simple as a Telnet connection on the jabberd port, as you will see shortly in the first examples in this chapter).
Architecturally, Jabber imposes very few restrictions on clients. The only things a Jabber client really has to do are
Communicate with one Jabber server over TCP sockets.
Parse and interpret XML "stanzas" over an XML stream. (The meaning of "XML Stream" is explained shortly.)
Understand a small set of core Jabber XML message types.