Class: WebSocketDataConnector

OSH.DataConnector. WebSocketDataConnector

Defines the AjaxConnector to connect to a remote server by making AjaxRequest.

new OSH.DataConnector.WebSocketDataConnector()

Example

var url = ...;
var connector = new OSH.DataConnector.WebSocketDataConnector(url);

// connect
connector.connect();

// disconnect
connector.disconnect();

// close
connector.close();

Extends

Methods

Closes the webSocket.

Connect to the webSocket. If the system supports WebWorker, it will automatically creates one otherwise use
the main thread.

Disconnects the websocket.

The data connector default id.

Returns:
Type Description
string

The stream url.

Returns:
Type Description
string

The onMessage method used by the websocket to callback the data

Name Type Description
data

the callback data