Using the ServiceHandler
init method
init method// when you want the ServiceHandler to automatically determine the best connection method, use this call.
ServiceHandler.init();
// when you want to use a specific websocket url, initialize with a call like this.
ServiceHandler.init(serverUrl);
// when you want to use a pre-existing websocket or any other socket connection (useful when calling from nodejs),
// you may pass the socket as the second argument. The socket must implement at least the `onmessage` and `send`
// methods like the native browser JavaScript WebSocket for sending and receiving messages and for closing connections.
ServiceHandler.init(null, socket);scheduler property
scheduler propertyUsing promises instead of callbacks...
serverUrl property
serverUrl propertyonready callback
onready callbackonclose callback
onclose callbackonerror callback
onerror callbackUsing the ServiceHandler.scheduler Object
Last updated