beautypg.com

Bosh, Addressing – Echelon SmartServer XMPP Client User Manual

Page 11

background image

SmartServer XMPP Client Developer’s Guide

3

The SmartServer supports the following XMPP extensions:

Bidirectional-streams Over
Synchronous HTTP
(BOSH, XEP-0124)

Specifies how a binary stream of data can be carried on the HTTP
protocol. XMPP uses a connection method that does not require a
client to maintain a long-lived TCP connection.

BOSH emulates a bidirectional streams that are similar to TCP
binding, but implemented efficiently using multiple, synchronous
HTTP or HTTPS request/response pairs.

XMPP over BOSH (XEP-
0206)

Specifies how XMPP can be implemented over a BOSH
connection.

SOAP over XMPP (XEP-
0072)

Specifies how SOAP messaging can be performed over XMPP.
The SmartServer uses SOAP for communicating with client
applications.

BOSH

BOSH is used by both the SmartServer and client applications to exchange data. BOSH-based systems
are usually deployed with a special connection manager that acts as a proxy between a client and the
XMPP Server. If a client resides behind a restrictive firewall, it has to be configured to use a BOSH
connection manager. The BOSH connection manager may be implemented on the same server with
the XMPP server, and many XMPP server implementations include an embedded BOSH connection
manager.

The client starts an XMPP session with the XMPP server by sending an initial HTTP or HTTPS
request to the BOSH connection manager. The BOSH connection manager then opens a regular
XMPP connection to the XMPP server, forwards the request, and receives an XMPP reply, which it
forwards to the client in an HTTP or HTTPS response. The client then authenticates with the XMPP
server. After the client has successfully authenticated with the XMPP server, it is ready for
communication.

During the client’s initial request, BOSH properties are used to drive the communication with the
BOSH connection manager, including the number of HTTP connections to use and a request timeout.
The value of the timeout property is determined by the client. When the client does not send or receive
any XMPP message for longer than the timeout period, the BOSH connection manager sends
keep-alive messages to the client if the timeout period is about to expire. If the client does not have
anything to send to the XMPP server, then the client also sends a keep-alive message with the defined
timeout. The client and the BOSH connection manager keep sending these keep-alive messages every
timeout interval until either the BOSH connection manager receives data for the client and returns it in
the response’s body, or the client sends new data within the request’s body.

Addressing

Each XMPP client (SmartServer or client application) requires a unique address, called a
Jabber ID (JID), which has the following format: [<userName>]@<hostname>/[<resource>=].
The following table describes each components of the JID:

userName

Identifies a user name registered with the XMPP server. XMPP
clients can use the user name of any user configured on the
XMPP server. For SmartServer clients, you can use the MAC
IDs as the userName to distinguish multiple SmartServer clients
more easily.

hostname

The hostname of the XMPP server. This may be the same as
the domain name of the XMPP server host, or it may be a
different name specified in the XMPP server configuration.

resource

Identifies a specific client belonging to the user (for example