fm.liveswitch.WebSocket Class Reference

Implementation of the WebSocket protocol v8. More...

Public Member Functions

void close ()
 Closes the WebSocket connection. More...
 
void close (fm.liveswitch.WebSocketCloseArgs closeArgs)
 Closes the WebSocket connection. More...
 
int getBufferedAmount ()
 Gets the number of bytes buffered in the send queue. More...
 
boolean getIsOpen ()
 Gets a value indicating whether the WebSocket is connected. More...
 
int getLastRoundTripTime ()
 Gets the last round trip time measured. More...
 
String getProtocol ()
 Gets the WebSocket protocol. More...
 
boolean getSecure ()
 Gets a value indicating whether the WebSocket is secure. More...
 
void open (fm.liveswitch.WebSocketOpenArgs openArgs)
 Opens the WebSocket connection. More...
 
void send (fm.liveswitch.WebSocketSendArgs sendArgs)
 Sends a message to the WebSocket server. More...
 
 WebSocket (String requestUrl)
 Creates a new fm.liveswitch.WebSocket. More...
 
 WebSocket (String requestUrl, String protocol)
 Creates a new fm.liveswitch.WebSocket. More...
 
- Public Member Functions inherited from fm.liveswitch.WebSocketBase
 WebSocketBase ()
 

Static Public Member Functions

static boolean getExists ()
 Gets a value indicating whether WebSocket support exists on this platform. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fm.liveswitch.WebSocketBase
void raiseCloseComplete (fm.liveswitch.WebSocketCloseArgs closeArgs, fm.liveswitch.WebSocketStatusCode statusCode, String reason)
 Raises the close complete callback. More...
 
void raiseOpenFailure (fm.liveswitch.WebSocketOpenArgs openArgs, fm.liveswitch.WebSocketStatusCode statusCode, java.lang.Exception exception)
 Raises the open failure callback. More...
 
void raiseOpenSuccess (fm.liveswitch.WebSocketOpenArgs openArgs)
 Raises the open success callback. More...
 
void raiseReceive (fm.liveswitch.WebSocketOpenArgs openArgs, String textMessage, byte[] binaryMessage)
 Raises the receive callback. More...
 
void raiseStreamFailure (fm.liveswitch.WebSocketOpenArgs openArgs, fm.liveswitch.WebSocketStatusCode statusCode, java.lang.Exception exception)
 Raises the stream failure callback. More...
 

Detailed Description

Implementation of the WebSocket protocol v8.

Constructor & Destructor Documentation

◆ WebSocket() [1/2]

fm.liveswitch.WebSocket.WebSocket ( String  requestUrl)

Creates a new fm.liveswitch.WebSocket.

Parameters
requestUrlThe target URL for the WebSocket connection.

◆ WebSocket() [2/2]

fm.liveswitch.WebSocket.WebSocket ( String  requestUrl,
String  protocol 
)

Creates a new fm.liveswitch.WebSocket.

Parameters
requestUrlThe target URL for the WebSocket connection.
protocolThe WebSocket protocol.

Member Function Documentation

◆ close() [1/2]

void fm.liveswitch.WebSocket.close ( )

Closes the WebSocket connection.

Implements fm.liveswitch.IWebSocket.

◆ close() [2/2]

void fm.liveswitch.WebSocket.close ( fm.liveswitch.WebSocketCloseArgs  closeArgs)

Closes the WebSocket connection.

Parameters
closeArgsThe close arguments

Implements fm.liveswitch.IWebSocket.

◆ getBufferedAmount()

int fm.liveswitch.WebSocket.getBufferedAmount ( )

Gets the number of bytes buffered in the send queue.

Implements fm.liveswitch.IWebSocket.

◆ getExists()

static boolean fm.liveswitch.WebSocket.getExists ( )
static

Gets a value indicating whether WebSocket support exists on this platform.

◆ getIsOpen()

boolean fm.liveswitch.WebSocket.getIsOpen ( )

Gets a value indicating whether the WebSocket is connected.

Implements fm.liveswitch.IWebSocket.

◆ getLastRoundTripTime()

int fm.liveswitch.WebSocket.getLastRoundTripTime ( )

Gets the last round trip time measured.

◆ getProtocol()

String fm.liveswitch.WebSocket.getProtocol ( )

Gets the WebSocket protocol.

◆ getSecure()

boolean fm.liveswitch.WebSocket.getSecure ( )

Gets a value indicating whether the WebSocket is secure.

Implements fm.liveswitch.IWebSocket.

◆ open()

void fm.liveswitch.WebSocket.open ( fm.liveswitch.WebSocketOpenArgs  openArgs)

Opens the WebSocket connection.

Parameters
openArgsThe open arguments.

Implements fm.liveswitch.IWebSocket.

◆ send()

void fm.liveswitch.WebSocket.send ( fm.liveswitch.WebSocketSendArgs  sendArgs)

Sends a message to the WebSocket server.

Parameters
sendArgsThe send arguments.

Implements fm.liveswitch.IWebSocket.