Converse converse.js

Class: Connection

Connection()

The Connection class manages the connection to the XMPP server. It's agnostic concerning the underlying protocol (i.e. websocket, long-polling via BOSH or websocket inside a shared worker).

Constructor

new Connection()

Source:

Classes

Connection

Methods

(static) onConnected(reconnecting)

Called as soon as a new connection has been established, either by logging in or by attaching to an existing BOSH session.

Parameters:
Name Type Description
reconnecting Boolean

Whether Converse.js reconnected from an earlier dropped session.

Source:

(static) setDisconnectionCause(cause, reasonopt, overrideopt)

Used to keep track of why we got disconnected, so that we can decide on what the next appropriate action is (in onDisconnected)

Parameters:
Name Type Attributes Description
cause Number

The status number as received from Strophe.

reason String <optional>

An optional user-facing message as to why there was a disconnection.

override Boolean <optional>

An optional flag to replace any previous disconnection cause and reason.

Source:

onConnectStatusChanged(status, message)

Callback method called by Strophe as the Connection goes through various states while establishing or tearing down a connection.

Parameters:
Name Type Description
status Number
message String
Source: