Constructor
new WebSocketFetchConnector()
Example
import WebSocketConnector from 'osh-js/dataconnector/WebSocketConnector.js';
let url = ...;
let connector = new WebSocketConnector(url);
// connect
connector.connect();
// disconnect
connector.disconnect();
// close
connector.close();Extends
Methods
checkStatus(status)
    Check a change of the status and call the corresponding callbacks if necessary
    Parameters:
| Name | Type | Description | 
|---|---|---|
| status | Status | the currentStatus | 
- Inherited From:
- Source:
doRequest()
    Connect to the webSocket. If the system supports WebWorker, it will automatically creates one otherwise use
the main thread.
        
            
    
    
    getId() → {String}
    The data protocol default id.
- Inherited From:
- Source:
Returns:
- Type
- String
getUrl() → {String}
    The stream url.
- Inherited From:
- Source:
Returns:
- Type
- String
onChangeStatus(status)
    Called when the connection STATUS changes
    Parameters:
| Name | Type | Description | 
|---|---|---|
| status | Status | the new status | 
- Inherited From:
- Source:
onConnect()
    Called when the protocol has been connected
- Inherited From:
- Source:
onDisconnect()
    Called when the protocol has been disconnected
- Inherited From:
- Source:
setReconnectTimeout(timeout)
    Sets the reconnection timeout
    Parameters:
| Name | Type | Description | 
|---|---|---|
| timeout | Number | delay in milliseconds before reconnecting dataSource | 
- Inherited From:
- Source:
setUrl(url)
    Sets the url
    Parameters:
| Name | Type | Description | 
|---|---|---|
| url | 
- Inherited From:
- Source: