An object that represents a single WebSocket connection. The object can be used to send messages and close the connection, and to receive notifications when messages are received or the connection is closed.
For internal use only.
WebSocket objects should never be created directly. They are obtained by
onWSOpen function to
The Rook request environment that opened the connection. This can be used to inspect HTTP headers, for example.
Registers a callback function that will be invoked whenever a message is received on this connection. The callback function will be invoked with two arguments. The first argument is
TRUEif the message is binary and
FALSEif it is text. The second argument is either a raw vector (if the message is binary) or a character vector.
Registers a callback function that will be invoked when the connection is closed.
Begins sending the given message over the websocket. The message must be either a raw vector, or a single-element character vector that is encoded in UTF-8.
Closes the websocket connection.
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.