Class: WebWindowHandle

JSROOT. WebWindowHandle

new JSROOT.WebWindowHandle()

Client communication handle for RWebWindow.

Should be created with JSROOT.connectWebWindow function

Methods

canSend(numsend)

Checks number of credits for send operation

Name Type Default Description
numsend number 1 optional

number of required send operations

Returns:
true if one allow to send specified number of text message to server

Cleanup and close connection.

Close connection

getChannelId()

Returns used channel ID, 1 by default

getRelCanSend()

Returns number of possible send operations relative to number of credits

getUserArgs(field)

Returns arguments specified in the RWebWindow::SetUserArgs() method

Can be any valid JSON expression. Undefined by default.

Name Type Description
field string optional

if specified and user args is object, returns correspondent object member

Returns:
user arguments object

send(msg, chid)

Send text message via the connection.

Name Type Description
msg string

text message to send

chid number optional

channel id, 1 by default, 0 used only for internal communication

setReceiver(obj)

Set callbacks receiver.

Name Type Description
obj object

object with receiver functions

Name Type Description
onWebsocketMsg function

called when new data receieved from RWebWindow

onWebsocketOpened function

called when connection established

onWebsocketClosed function

called when connection closed

onWebsocketError function

called when get error via the connection

setUserArgs()

Set user args

Normally set via RWebWindow::SetUserArgs() method