Selecting a client library

In order to use XMPP in your projects, the easiest way is to use a predefined client library. Such a library will help you with the basics of connecting and maintaining an XMPP connection, allow you to define and add extensions, send and receive stanzas, and so on. It will also provide you with a basic set of extensions already implemented, and a mechanism to add plugins.

There are many libraries on the internet to choose from, too many to list here. The XSF publishes a shortened list of client libraries at https://xmpp.org/software/libraries.html.

In this book, we will use the Waher.Networking.XMPP client library, written in C#. It's available on GitHub and as NuGets (in two versions: one .NET Standard and one for the first generation Universal Windows Platform, UWP). There are also plugins available for the Internet of Things that we will use.

The operating principle of this library is simple. In the constructor, you define sufficient information to connect. You then connect calling the Connect method. The reception of standard stanzas triggers events on the client. Extensions are added by registering message, iq, and presence handlers on the client. During initialization, you simply provide the fully qualified names of the elements you extend the client with, and the corresponding callback methods the client will call when the corresponding extensions are referenced.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.214.32