| websocket {animate} | R Documentation |
Start a Websocket server
Description
A thin wrapper of the httpuv package, modified to serve animated
plots.
Public fields
appA list of functions that define the application.
serverA server handle to be used by 'stopServer'.
wsA WebSocket channel to handle the communication between the R session and the browser session.
in_handlerA function to handle instructions sent by the browser session.
portAn integer; the TCP port number.
connectedTRUE or FALSE; whether a connection has been established. One should start the WebSocket server before launching the web page that connects to the server.
startedTRUE or FALSE; whether a server has been started. Use the
startServermethod to start a server.
Methods
Public methods
Method startServer()
Start a WebSocket server
Usage
websocket$startServer()
Method stopServer()
Stop a WebSocket server
Usage
websocket$stopServer()
Method listServers()
List all running WebSocket servers
Usage
websocket$listServers()
Method stopAllServers()
Stop all running WebSocket servers
Usage
websocket$stopAllServers()
Method new()
Initialise a WebSocket connection
Usage
websocket$new(in_handler, port = 9454)
Arguments
in_handlerA function to handle incoming message, default to be print which only displays the message without any processing.
portAn integer; the TCP port number.
Returns
A 'websocket' object.
Method clone()
The objects of this class are cloneable with this method.
Usage
websocket$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.