fm.liveswitch.WebSocketWebRequestTransfer Class Reference

Defines methods for transferring messages using the WebSocket protocol. More...

Public Member Functions

void open (java.util.HashMap< String, String > headers)
 Opens the WebSocket connection. More...
 
fm.liveswitch.HttpResponseArgs send (fm.liveswitch.HttpRequestArgs requestArgs)
 Sends a request synchronously. More...
 
void sendAsync (fm.liveswitch.HttpRequestArgs requestArgs, fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs > callback)
 Sends a request asynchronously. More...
 
void shutdown ()
 Releases any resources and shuts down. More...
 
 WebSocketWebRequestTransfer (String url)
 Creates a new instance of fm.liveswitch.WebSocketWebRequestTransfer. More...
 
- Public Member Functions inherited from fm.liveswitch.WebSocketTransfer
int getHandshakeTimeout ()
 Gets the timeout for the initial handshake (in ms). More...
 
fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenFailureArgsgetOnOpenFailure ()
 Gets the callback to invoke if the handshake fails. More...
 
fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenSuccessArgsgetOnOpenSuccess ()
 Gets the callback to invoke if the handshake succeeds. More...
 
fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgsgetOnRequestCreated ()
 Gets the callback to invoke when the handshake request is created. More...
 
fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgsgetOnResponseReceived ()
 Gets the callback to invoke when the handshake response is received. More...
 
fm.liveswitch.IAction1< fm.liveswitch.WebSocketStreamFailureArgsgetOnStreamFailure ()
 Gets the callback to invoke if the stream errors out. More...
 
Object getSender ()
 Gets the sender of the messages. More...
 
int getStreamTimeout ()
 Gets the timeout for the stream (in ms). More...
 
String getUrl ()
 Gets the URL. More...
 
void setHandshakeTimeout (int value)
 Sets the timeout for the initial handshake (in ms). More...
 
void setOnOpenFailure (fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenFailureArgs > value)
 Sets the callback to invoke if the handshake fails. More...
 
void setOnOpenSuccess (fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenSuccessArgs > value)
 Sets the callback to invoke if the handshake succeeds. More...
 
void setOnRequestCreated (fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgs > value)
 Sets the callback to invoke when the handshake request is created. More...
 
void setOnResponseReceived (fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgs > value)
 Sets the callback to invoke when the handshake response is received. More...
 
void setOnStreamFailure (fm.liveswitch.IAction1< fm.liveswitch.WebSocketStreamFailureArgs > value)
 Sets the callback to invoke if the stream errors out. More...
 
void setSender (Object value)
 Sets the sender of the messages. More...
 
void setStreamTimeout (int value)
 Sets the timeout for the stream (in ms). More...
 
void setUrl (String value)
 Sets the URL. More...
 
 WebSocketTransfer (String url)
 Initializes a new instance of the fm.liveswitch.WebSocketTransfer class. More...
 

Detailed Description

Defines methods for transferring messages using the WebSocket protocol.

Constructor & Destructor Documentation

◆ WebSocketWebRequestTransfer()

fm.liveswitch.WebSocketWebRequestTransfer.WebSocketWebRequestTransfer ( String  url)

Creates a new instance of fm.liveswitch.WebSocketWebRequestTransfer.

Parameters
urlThe URL.

Member Function Documentation

◆ open()

void fm.liveswitch.WebSocketWebRequestTransfer.open ( java.util.HashMap< String, String >  headers)

Opens the WebSocket connection.

Reimplemented from fm.liveswitch.WebSocketTransfer.

◆ send()

fm.liveswitch.HttpResponseArgs fm.liveswitch.WebSocketWebRequestTransfer.send ( fm.liveswitch.HttpRequestArgs  requestArgs)

Sends a request synchronously.

Parameters
requestArgsThe request parameters.
Returns
The response parameters.

Reimplemented from fm.liveswitch.WebSocketTransfer.

◆ sendAsync()

void fm.liveswitch.WebSocketWebRequestTransfer.sendAsync ( fm.liveswitch.HttpRequestArgs  requestArgs,
fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs callback 
)

Sends a request asynchronously.

Parameters
requestArgsThe request parameters.
callbackThe callback to execute with the resulting response.

Reimplemented from fm.liveswitch.WebSocketTransfer.

◆ shutdown()

void fm.liveswitch.WebSocketWebRequestTransfer.shutdown ( )

Releases any resources and shuts down.

Reimplemented from fm.liveswitch.WebSocketTransfer.