Converse converse.js

Class: WorkerWebsocket

WorkerWebsocket(connection)

Helper class that handles a websocket connection inside a shared worker.

Constructor

new WorkerWebsocket(connection)

Create and initialize a Strophe.WorkerWebsocket object.

Parameters:
Name Type Description
connection Connection

The Strophe.Connection

Source:

Methods

_attach(callback)

Parameters:
Name Type Description
callback function
Source:

_attachCallback(status, jid)

Parameters:
Name Type Description
status number
jid string
Source:

_disconnect(pres)

Parameters:
Name Type Description
pres Element | Builder

This stanza will be sent before disconnecting.

Source:

_messageHandler(m)

Parameters:
Name Type Description
m MessageEvent
Source:

_messageHandler(m)

Parameters:
Name Type Description
m MessageEvent
Source:

_messageHandler(m)

Parameters:
Name Type Description
m MessageEvent
Source:

(private) _onWorkerMessage(ev)

function that handles messages received from the service worker

Parameters:
Name Type Description
ev MessageEvent
Source:

_replaceMessageHandler()

Called by _onInitialMessage in order to replace itself with the general message handler. This method is overridden by WorkerWebsocket, which manages a websocket connection via a service worker and doesn't have direct access to the socket.

Source:

(private) _setSocket()

Source: