FMLiveSwitchDataChannelBase Class Reference

Data channel base properties/methods. More...

Instance Methods

(TDataChannel) - addOnStateChangeWithBlock
 Adds a handler that is raised when the data channel state changes. More...
 
(void) - addOnStateChangeWithBlock:
 Adds a handler that is raised when the data channel state changes. More...
 
(long long) - bytesReceived
 Gets the number of bytes received. More...
 
(long long) - bytesSent
 Gets the number of bytes sent. More...
 
(NSString *) - connectionId
 Gets the connection identifier. More...
 
(NSString *) - id
 Gets the identifier. More...
 
(FMLiveSwitchDataChannelInfo *) - info
 Gets the data channel info. More...
 
(instancetype) - initWithLabel:ordered:subprotocol:
 Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class. More...
 
(instancetype) - initWithLabel:ordered:subprotocol:internalChannel:
 Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class. More...
 
(TDataChannel) - instance
 Gets the current instance. More...
 
(bool) - isInternal
 Gets a value indicating if this is an internal data channel. More...
 
(bool) - isTerminated
 Gets a value indicating whether the data channel is currently closed or failed. More...
 
(bool) - isTerminating
 Gets a value indicating whether the data channel is currently closing. More...
 
(bool) - isTerminatingOrTerminated
 Gets a value indicating whether the data channel is currently closing, closed, or failed. More...
 
(NSString *) - label
 Gets the label. More...
 
(long long) - messagesReceived
 Gets the number of messages received. More...
 
(long long) - messagesSent
 Gets the number of messages sent. More...
 
(FMLiveSwitchAction1< FMLiveSwitchDataChannelReceiveArgs * > *) - onReceive
 Gets a callback invoked when a message is received. More...
 
(bool) - ordered
 Gets a value indicating whether messages will be delivered in the order they are sent. More...
 
(void) - processStateChange
 Processes a state change. More...
 
(void) - processStateLockChange
 Processes a state lock change. More...
 
(void) - raiseDataBytes:
 Raises the OnReceive callback with data bytes. More...
 
(void) - raiseDataString:
 Raises the OnReceive callback with a data string. More...
 
(void) - registerDataReceivedWithDataLength:
 Registers that a data has been sent. More...
 
(void) - registerDataSentWithDataLength:
 Registers that a data has been sent. More...
 
(void) - removeOnStateChange:
 Removes a handler that is raised when the data channel state changes. More...
 
(FMLiveSwitchFuture< id > *) - sendDataBytes:
 Sends some bytes. More...
 
(FMLiveSwitchFuture< id > *) - sendDataString:
 Sends a string. More...
 
(void) - setOnReceive:
 Sets a callback invoked when a message is received. More...
 
(FMLiveSwitchDataChannelReceiveArgs *) - setOnReceiveBlock
 Sets a callback invoked when a message is received. More...
 
(void) - setOnReceiveBlock:
 Sets a callback invoked when a message is received. More...
 
(FMLiveSwitchDataChannelState) - state
 Gets the state. More...
 
(NSString *) - streamId
 Gets the stream identifier. More...
 
(NSString *) - subprotocol
 Gets the subprotocol. More...
 

Class Methods

(FMLiveSwitchDataChannelBase *) + dataChannelBaseWithLabel:ordered:subprotocol:
 Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class. More...
 
(FMLiveSwitchDataChannelBase *) + dataChannelBaseWithLabel:ordered:subprotocol:internalChannel:
 Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class. More...
 

Protected Attributes

 __pad0__: FMLiveSwitchDynamic<FMLiveSwitchIDataChannel>- (void) addOnStateChange:(FMLiveSwitchAction1<TDataChannel>*)value
 

Detailed Description

Data channel base properties/methods.

Method Documentation

◆ addOnStateChangeWithBlock

- (TDataChannel) addOnStateChangeWithBlock

Adds a handler that is raised when the data channel state changes.

◆ addOnStateChangeWithBlock:

- (void) addOnStateChangeWithBlock: (void(^)(TDataChannel))  valueBlock

Adds a handler that is raised when the data channel state changes.

◆ bytesReceived

- (long long) bytesReceived

Gets the number of bytes received.

◆ bytesSent

- (long long) bytesSent

Gets the number of bytes sent.

◆ connectionId

- (NSString*) connectionId

Gets the connection identifier.

◆ dataChannelBaseWithLabel:ordered:subprotocol:

+ (FMLiveSwitchDataChannelBase*) dataChannelBaseWithLabel: (NSString *)  label
ordered: (bool)  ordered
subprotocol: (NSString *)  subprotocol 

Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class.

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

◆ dataChannelBaseWithLabel:ordered:subprotocol:internalChannel:

+ (FMLiveSwitchDataChannelBase*) dataChannelBaseWithLabel: (NSString *)  label
ordered: (bool)  ordered
subprotocol: (NSString *)  subprotocol
internalChannel: (bool)  internalChannel 

Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class.

Parameters
labelThe label.
orderedWhether messages will be delivered in the order they are sent.
subprotocolThe subprotocol.
internalChannelIndicates whether this is an internal channel.

◆ id

- (NSString*) id

Gets the identifier.

◆ info

Gets the data channel info.

◆ initWithLabel:ordered:subprotocol:

- (instancetype) initWithLabel: (NSString *)  label
ordered: (bool)  ordered
subprotocol: (NSString *)  subprotocol 

Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class.

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

Implemented in FMLiveSwitchDataChannel.

◆ initWithLabel:ordered:subprotocol:internalChannel:

- (instancetype) initWithLabel: (NSString *)  label
ordered: (bool)  ordered
subprotocol: (NSString *)  subprotocol
internalChannel: (bool)  internalChannel 

Initializes a new instance of the FMLiveSwitchDataChannelBase`1 class.

Parameters
labelThe label.
orderedWhether messages will be delivered in the order they are sent.
subprotocolThe subprotocol.
internalChannelIndicates whether this is an internal channel.

◆ instance

- (TDataChannel) instance

Gets the current instance.

Implemented in FMLiveSwitchDataChannel.

◆ isInternal

- (bool) isInternal

Gets a value indicating if this is an internal data channel.

◆ isTerminated

- (bool) isTerminated

Gets a value indicating whether the data channel is currently closed or failed.

◆ isTerminating

- (bool) isTerminating

Gets a value indicating whether the data channel is currently closing.

◆ isTerminatingOrTerminated

- (bool) isTerminatingOrTerminated

Gets a value indicating whether the data channel is currently closing, closed, or failed.

◆ label

- (NSString*) label

Gets the label.

◆ messagesReceived

- (long long) messagesReceived

Gets the number of messages received.

◆ messagesSent

- (long long) messagesSent

Gets the number of messages sent.

◆ onReceive

- (FMLiveSwitchAction1<FMLiveSwitchDataChannelReceiveArgs*>*) onReceive

Gets a callback invoked when a message is received.

Example:

channel.setOnReceive { [weak self] (messageArgs: Any!) in
let message = messageArgs as! FMLiveSwitchDataChannelArgs
// Do something
}

◆ ordered

- (bool) ordered

Gets a value indicating whether messages will be delivered in the order they are sent.

◆ processStateChange

- (void) processStateChange

Processes a state change.

◆ processStateLockChange

- (void) processStateLockChange

Processes a state lock change.

Implemented in FMLiveSwitchDataChannel.

◆ raiseDataBytes:

- (void) raiseDataBytes: (FMLiveSwitchDataBuffer *)  dataBytes

Raises the OnReceive callback with data bytes.

Parameters
dataBytesThe data bytes.

◆ raiseDataString:

- (void) raiseDataString: (NSString *)  dataString

Raises the OnReceive callback with a data string.

Parameters
dataStringThe data string.

◆ registerDataReceivedWithDataLength:

- (void) registerDataReceivedWithDataLength: (int)  dataLength

Registers that a data has been sent.

Parameters
dataLengthThe data length.

◆ registerDataSentWithDataLength:

- (void) registerDataSentWithDataLength: (int)  dataLength

Registers that a data has been sent.

Parameters
dataLengthThe data length.

◆ removeOnStateChange:

- (void) removeOnStateChange: (FMLiveSwitchAction1< TDataChannel > *)  value

Removes a handler that is raised when the data channel state changes.

◆ sendDataBytes:

- (FMLiveSwitchFuture<id>*) sendDataBytes: (FMLiveSwitchDataBuffer *)  dataBytes

Sends some bytes.

Parameters
dataBytesThe data bytes.

Implemented in FMLiveSwitchDataChannel.

◆ sendDataString:

- (FMLiveSwitchFuture<id>*) sendDataString: (NSString *)  dataString

Sends a string.

Parameters
dataStringThe data string.

Implemented in FMLiveSwitchDataChannel.

◆ setOnReceive:

- (void) setOnReceive: (FMLiveSwitchAction1< FMLiveSwitchDataChannelReceiveArgs * > *)  value

Sets a callback invoked when a message is received.

Example:

channel.setOnReceive { [weak self] (messageArgs: Any!) in
let message = messageArgs as! FMLiveSwitchDataChannelArgs
// Do something
}

◆ setOnReceiveBlock

- (FMLiveSwitchDataChannelReceiveArgs*) setOnReceiveBlock

Sets a callback invoked when a message is received.

Example:

channel.setOnReceive { [weak self] (messageArgs: Any!) in
let message = messageArgs as! FMLiveSwitchDataChannelArgs
// Do something
}

◆ setOnReceiveBlock:

- (void) setOnReceiveBlock: (void(^)(FMLiveSwitchDataChannelReceiveArgs *))  valueBlock

Sets a callback invoked when a message is received.

Example:

channel.setOnReceive { [weak self] (messageArgs: Any!) in
let message = messageArgs as! FMLiveSwitchDataChannelArgs
// Do something
}

◆ state

- (FMLiveSwitchDataChannelState) state

Gets the state.

◆ streamId

- (NSString*) streamId

Gets the stream identifier.

◆ subprotocol

- (NSString*) subprotocol

Gets the subprotocol.

Member Data Documentation

◆ __pad0__

- __pad0__
protected