Pages
core
Search
Entities
WebSocket
Functions
Closes the given websocket connection.
WebSocket.close(websocket)
If the reconnectOnClose
flag was specified then the connection will
reconnect using this function.
Closes the given websocket connection without reconnecting, even if the
reconnectOnClose
flag was set.
WebSocket.closeWithoutReconnecting(websocket)
Creates a websocket connection from the given configuration:
websocket =
WebSocket.open({
url: "wss://echo.websocket.org",
reconnectOnClose: true,
onMessage: handleMessage,
onError: handleError,
onClose: handleClose,
onOpen: handleOpen
})
If reconnectOnClose
is set then when a connection is closed it tries to
reconnect, using the same configuration (basically calls open again).
Sends the given data to the given websocket connection.
WebSocket.send(websocket, "some data")