B4J Programming Press on the image to return to the main documentation page.

rWebSocketClient

List of types:

WebSocketClient

WebSocketClient

WebSocket client implementation. It is intended to work with B4J WebSocket servers.

Events:

Disconnected
NewMessage (FunctionName As String, Params() As String)

Members:


  ConnectHost (Stream As B4RStream, Host As String, Port As UInt, Path As String) As Boolean

  ConnectIP (Stream As B4RStream, IP() As Byte, Port As UInt, Path As String) As Boolean

  Initialize (NewMessageSub As SubVoidStringArray, DisconnectedSub As SubVoidVoid) As void

  SendEventToServer (Event As String, DataMap() As String) As void

Members description:

ConnectHost (Stream As B4RStream, Host As String, Port As UInt, Path As String) As Boolean
Tries to connect to the server. Returns true if connection was successful.
Stream - Stream of an unconnected client.
Host - Host name.
Port - Port number.
Path - WebSocket handler path.
ConnectIP (Stream As B4RStream, IP() As Byte, Port As UInt, Path As String) As Boolean
Tries to connect to the server. Returns true if connection was successful.
Stream - Stream of an unconnected client.
IP - Server ip address as an array of bytes.
Port - Port number.
Path - WebSocket handler path.
Initialize (NewMessageSub As SubVoidStringArray, DisconnectedSub As SubVoidVoid) As void
Initializes the object and set the NewMessage and Disconnected subs.
SendEventToServer (Event As String, DataMap() As String) As void
Raises an event on the server.
Event - Event name. Must include an underscore.
DataMap - An array of strings with the parameters. The parameters will be converted to a
key / value map on the server side. Number of parameters must be even.
Quotes are not allowed.
Top