Book Image

Practical XMPP

By : Steven Watkin, David Koelle
Book Image

Practical XMPP

By: Steven Watkin, David Koelle

Overview of this book

XMPP (eXtensible Messaging and Presence Protocol) is a messaging protocol that enables communication between two or more devices via the Internet. With this book, developers will learn about the fundamentals of XMPP, be able to work with the core functionality both server-side and in the browser, as well as starting to explore several of the protocol extensions. You will not only have a solid grasp of XMPP and how it works, but will also be able to use the protocol to build real-world applications that utilize the power of XMPP. By the end of this book, you will know more about networking applications in general, and have a good understanding of how to extend XMPP, as well as using it in sample applications.
Table of Contents (16 chapters)
Practical XMPP
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
An Introduction to XMPP and Installing Our First Server

Joining a room


Let's take the example of Biff Tannen ([email protected]) and his gang hanging out at Lou's café, which we'll refer to as [email protected].

Notice that a chat room address looks just like a JID! The MUC room itself will sit on a domain handled by an XMPP server and the local part becomes the identifier of the room itself, in this case, gang. This means that an MUC room is just a JID that you can talk to.

Now, joining a non-password-protected room is simple: no, wait! It's really simple. In essence, all we do is send a directed Presence (remember that from Chapter 2, Diving into the Core XMPP Concepts?) to the room we want to join with a chosen nickname (more on that later) and, provided it is not taken, we're in!

Let's say Marty turns up at the diner and wants to step into the conversation to help out George McFly:

<presence from='[email protected]/diner' 
id='join1' 
to='[email protected]/calvin' /> 

Note

Technically, we should also include a child element that signifies...