O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an XMPP chat server

As with the other server objects, we first need a variable to hold the reference to our chat server. We also need a Bits of Binary client. Bits of Binary is a mechanism to transfer small chunks of binary information from one client to another and is defined in XEP-0231. It is one of several methods the chat server can use to transfer images:

private BobClient bobClient = null; 
private ChatServer chatServer = null; 

In our AttachFeatures method, we create the instance as follows. We ask our Bits of Binary-client to temporarily use the TEMP folder to store binary information, if necessary. In the constructor of our chat server, we also provide a reference to our sensor server:

this.bobClient = new BobClient(this.xmppClient, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required