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. -
disconnect()
-
Disconnects the websocket.
-
inherited getId(){string}
-
The data connector default id.
Returns:
Type Description string -
inherited getUrl(){string}
-
The stream url.
Returns:
Type Description string -
onMessage(data)
-
The onMessage method used by the websocket to callback the data
Name Type Description datathe callback data