fm.liveswitch.DataChannel Class Reference

A data channel. More...

Public Member Functions

 DataChannel (String label)
 Initializes a new instance of the fm.liveswitch.DataChannel class. More...
 
 DataChannel (String label, boolean ordered)
 Initializes a new instance of the fm.liveswitch.DataChannel class. More...
 
 DataChannel (String label, boolean ordered, String subprotocol)
 Initializes a new instance of the fm.liveswitch.DataChannel class. More...
 
fm.liveswitch.Future< Object > sendDataBytes (fm.liveswitch.DataBuffer dataBytes)
 Sends bytes. More...
 
fm.liveswitch.Future< Object > sendDataString (String dataString)
 Sends a string. More...
 
- Public Member Functions inherited from fm.liveswitch.DataChannelBase< fm.liveswitch.DataChannel >
void addOnStateChange (fm.liveswitch.IAction1< TDataChannel > value)
 Adds a handler that is raised when the data channel state changes. More...
 
long getBytesReceived ()
 Gets the number of bytes received. More...
 
long getBytesSent ()
 Gets the number of bytes sent. More...
 
String getConnectionId ()
 Gets the connection identifier. More...
 
String getId ()
 Gets the identifier. More...
 
fm.liveswitch.DataChannelInfo getInfo ()
 Gets the data channel info. More...
 
boolean getIsInternal ()
 Gets a value indicating if this is an internal data channel. More...
 
boolean getIsTerminated ()
 Gets a value indicating whether the data channel is currently closed or failed. More...
 
boolean getIsTerminating ()
 Gets a value indicating whether the data channel is currently closing. More...
 
boolean getIsTerminatingOrTerminated ()
 Gets a value indicating whether the data channel is currently closing, closed, or failed. More...
 
String getLabel ()
 Gets the label. More...
 
long getMessagesReceived ()
 Gets the number of messages received. More...
 
long getMessagesSent ()
 Gets the number of messages sent. More...
 
fm.liveswitch.IAction1< fm.liveswitch.DataChannelReceiveArgsgetOnReceive ()
 Gets a callback invoked when a message is received. More...
 
boolean getOrdered ()
 Gets a value indicating whether messages will be delivered in the order they are sent. More...
 
fm.liveswitch.DataChannelState getState ()
 Gets the state. More...
 
String getStreamId ()
 Gets the stream identifier. More...
 
String getSubprotocol ()
 Gets the subprotocol. More...
 
void removeOnStateChange (fm.liveswitch.IAction1< TDataChannel > value)
 Removes a handler that is raised when the data channel state changes. More...
 
abstract fm.liveswitch.Future< Object > sendDataBytes (fm.liveswitch.DataBuffer dataBytes)
 Sends some bytes. More...
 
abstract fm.liveswitch.Future< Object > sendDataString (String dataString)
 Sends a string. More...
 
void setOnReceive (fm.liveswitch.IAction1< fm.liveswitch.DataChannelReceiveArgs > value)
 Sets a callback invoked when a message is received. More...
 

Protected Member Functions

fm.liveswitch.DataChannel getInstance ()
 Gets the current instance. More...
 
void processStateLockChange ()
 Processes a state lock change. More...
 
- Protected Member Functions inherited from fm.liveswitch.DataChannelBase< fm.liveswitch.DataChannel >
 DataChannelBase (String label, boolean ordered, String subprotocol)
 Initializes a new instance of the fm.liveswitch.DataChannelBase class. More...
 
 DataChannelBase (String label, boolean ordered, String subprotocol, boolean internalChannel)
 Initializes a new instance of the fm.liveswitch.DataChannelBase class. More...
 
abstract TDataChannel getInstance ()
 Gets the current instance. More...
 
void processStateChange ()
 Processes a state change. More...
 
void processStateLockChange ()
 Processes a state lock change. More...
 
void raiseDataBytes (fm.liveswitch.DataBuffer dataBytes)
 Raises the OnReceive callback with data bytes. More...
 
void raiseDataString (String dataString)
 Raises the OnReceive callback with a data string. More...
 
void registerDataReceived (int dataLength)
 Registers that a data has been sent. More...
 
void registerDataSent (int dataLength)
 Registers that a data has been sent. More...
 

Detailed Description

A data channel.

Constructor & Destructor Documentation

◆ DataChannel() [1/3]

fm.liveswitch.DataChannel.DataChannel ( String  label)

Initializes a new instance of the fm.liveswitch.DataChannel class.

Parameters
labelThe label.

◆ DataChannel() [2/3]

fm.liveswitch.DataChannel.DataChannel ( String  label,
boolean  ordered 
)

Initializes a new instance of the fm.liveswitch.DataChannel class.

Parameters
labelThe label.
orderedif set to
true
[ordered].

◆ DataChannel() [3/3]

fm.liveswitch.DataChannel.DataChannel ( String  label,
boolean  ordered,
String  subprotocol 
)

Initializes a new instance of the fm.liveswitch.DataChannel class.

Parameters
labelThe label.
orderedWhether messages will be delivered in the order they are sent.
subprotocolThe subprotocol.

Member Function Documentation

◆ getInstance()

fm.liveswitch.DataChannel fm.liveswitch.DataChannel.getInstance ( )
protected

Gets the current instance.

◆ processStateLockChange()

void fm.liveswitch.DataChannel.processStateLockChange ( )
protected

Processes a state lock change.

◆ sendDataBytes()

fm.liveswitch.Future<Object> fm.liveswitch.DataChannel.sendDataBytes ( fm.liveswitch.DataBuffer  dataBytes)

Sends bytes.

Parameters
dataBytesThe data bytes.

◆ sendDataString()

fm.liveswitch.Future<Object> fm.liveswitch.DataChannel.sendDataString ( String  dataString)

Sends a string.

Parameters
dataStringThe data string.