websocket_write: websocket_write

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/websockets.R

Description

Write data to a websocket connection.

Usage

1
websocket_write(DATA, WS)

Arguments

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.

Details

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]].

Value

The number of bytes sent or an error. A returned value of -1 indicates that the websocket client socket should be closed.

Author(s)

B. W. Lewis <blewis@illposed.net>

See Also

setCallback

Examples

1
##

rstudio/R-Websockets documentation built on May 28, 2019, 4:33 a.m.