@hallparty/xmpp-reconnect

0.12.0 • Public • Published

reconnect

Auto reconnect for @hallparty/xmpp-client and @hallparty/xmpp-component.

Included and enabled in @hallparty/xmpp-component and @hallparty/xmpp-client.

Supports Node.js and browsers.

Each reconnect will re-use the options provided to the entity start method.

delay property

Property to set/get the delay in milliseconds between connection closed and reconnecting.

Default is 1000.

reconnect.delay; // 1000
reconnect.delay = 2000;

reconnecting event

Emitted each time a re-connection is attempted.

reconnect.on("reconnecting", () => {
  console.log("reconnecting");
});

reconnected event

Emitted each time a re-connection succeed.

reconnect.on("reconnected", () => {
  console.log("reconnected");
});

error event

Emitted on entity each time a re-connection fails.

entity.on("error", (err) => {
  console.error(err);
});

/@hallparty/xmpp-reconnect/

    Package Sidebar

    Install

    npm i @hallparty/xmpp-reconnect

    Weekly Downloads

    1

    Version

    0.12.0

    License

    ISC

    Unpacked Size

    3.64 kB

    Total Files

    4

    Last publish

    Collaborators

    • hallparty