WebWindowHandle

WebWindowHandle

new WebWindowHandle()

Client communication handle for RWebWindow.

Description:
Source:

Methods

(private) addReloadKeyHandler()

Instal Ctrl-R handler to realod web window

Description:
  • Instead of default window reload invokes askReload method WARNING - only call when you know that you are doing

Source:

(private) askReload()

Send newkey request to application

Description:
  • If server creates newkey and response - webpage will be reaload After key generation done, connection will not be working any longer WARNING - only call when you know that you are doing

Source:

canSend(numsendopt)

Checks number of credits for send operation

Source:
Parameters:
Name Type Attributes Default Description
numsend number <optional>
1

number of required send operations

Returns:

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

cleanup()

Cleanup and close connection.

Source:

close()

Close connection

Source:

(private) connect()

Create configured socket for current object.

Source:

(private) createChannel()

Method open channel, which will share same connection, but can be used independently from main

Source:

getChannelId()

Returns used channel ID, 1 by default

Source:

(private) getConnArgs()

provide connection args for the web socket

Source:

(private) getHRef(relative_pathopt)

Return href part

Source:
Parameters:
Name Type Attributes Description
relative_path string <optional>

relative path to the handle

getRelCanSend()

Returns number of possible send operations relative to number of credits

Source:

getUserArgs(fieldopt)

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

Description:
  • Can be any valid JSON expression. Undefined by default.

Source:
Parameters:
Name Type Attributes Description
field string <optional>

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

Returns:

user arguments object

(private) inject()

Inject message(s) into input queue, for debug purposes only

Source:

(private) invokeReceiver()

Invoke method in the receiver.

Source:

isConnected()

Returns true if socket connected

Source:

(private) keepAlive()

Send keep-alive message.

Description:
  • Only for internal use, only when used with websockets

Source:

(private) markQueueItemDone()

Provide data for item which was reserved before.

Source:

(private) processQueue()

Process completed messages in the queue

Source:

(private) provideData()

Provide data for receiver. When no queue - do it directly.

Source:

(private) reserveQueueItem()

Reserve entry in queue for data, which is not yet decoded.

Source:

resizeWindow()

Request server to resize window

Description:
  • For local displays like CEF or qt5 only server can do this

Source:

send(msg, chidopt)

Send text message via the connection.

Source:
Parameters:
Name Type Attributes Description
msg string

text message to send

chid number <optional>

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

(private) sendLast()

Send only last message of specified kind during defined time interval.

Description:
  • Idea is to prvent sending multiple messages of similar kind and overload connection Instead timeout is started after which only last specified message will be send

Source:

(private) setHRef(pathopt)

Assign href parameter

Source:
Parameters:
Name Type Attributes Description
path string <optional>

absolute path, when not specified window.location.url will be used

setReceiver(obj)

Set callbacks receiver.

Source:
Parameters:
Name Type Description
obj object

object with receiver functions

Properties
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

Description:
  • Normally set via RWebWindow::SetUserArgs() method

Source: