Description Usage Arguments Details Value Author(s) See Also Examples
Write data to a websocket connection.
1 | websocket_write(DATA, WS)
|
DATA |
A character string or RAW vector to write. |
WS |
A websocket client from a websocket server environment or a callback function. See the 'details' section below for more information. |
The WS
argument must be a websocket client which is represented as
a list. All connected clients are stored in the environment associated
with a webserver in the client_sockets
list. Because each connected
client is itself a list, be careful to access a single client element,
for example with the '[[' indexing operator, shown here accessing the
first client socket:
WS$client_sockets[[1]]
.
The number of bytes sent or an error. A returned value of -1 indicates that the websocket client socket should be closed.
B. W. Lewis <blewis@illposed.net>
1 | ##
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.