Book Image

Practical XMPP

By : Lloyd Watkin, Steven Watkin, Koelle
Book Image

Practical XMPP

By: Lloyd Watkin, Steven Watkin, 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 (11 chapters)
Free Chapter
1
1. An Introduction to XMPP and Installing Our First Server

<presence/>


Presence is all about communicating the current state or availability. If you think about IM systems, then this is the online, busy, away, or offline status of another user. For real-time communications, it is important to know whether another user is available when you send them a message so that you can (hopefully) receive a timely response.

The following is an example of a user sending their presence to their XMPP server (note that this can be achieved by not setting the to attribute), telling the server that they are online and ready to receive push updates. For example if Marty arrived late at school because Doc Brown set all the clocks incorrectly, he can also set a status message:

<presence from="[email protected]/highschool"> 
  <show>available</show> 
  <status>Damn alarm clocks!</status> 
</presence> 

User presence updates generally have three (all optional) children, which are as follows:

  • type: The availability...