/ fm / liveswitch / WebRtcDataChannelBase
Class: WebRtcDataChannelBase<TDataChannel>
fm.liveswitch.WebRtcDataChannelBase
Data channel base properties/methods.
Type parameters
Name |
---|
TDataChannel |
Hierarchy
-
↳ WebRtcDataChannelBase
Implements
- IDataChannel<TDataChannel>
Table of contents
Constructors
Methods
- addOnStateChange
- fmliveswitchWebRtcDataChannelBaseInit
- getBytesReceived
- getBytesSent
- getConnectionId
- getDynamicProperties
- getDynamicValue
- getId
- getInfo
- getInstance
- getIsInternal
- getIsTerminated
- getIsTerminating
- getIsTerminatingOrTerminated
- getLabel
- getMessagesReceived
- getMessagesSent
- getOnReceive
- getOrdered
- getState
- getStreamId
- getSubprotocol
- getTypeString
- processStateChange
- processStateLockChange
- raiseDataBytes
- raiseDataString
- registerDataReceived
- registerDataSent
- removeOnStateChange
- sendDataBytes
- sendDataString
- setDynamicValue
- setOnReceive
- unsetDynamicValue
Constructors
constructor
+ new WebRtcDataChannelBase<TDataChannel>(label
: string, ordered
: boolean, subprotocol
: string): WebRtcDataChannelBase<TDataChannel>
Initializes a new instance of the [[fm.liveswitch.dataChannelBase]] class.
Type parameters:
Name |
---|
TDataChannel |
Parameters:
Name | Type | Description |
---|---|---|
label |
string | The label. |
ordered |
boolean | Whether messages will be delivered in the order they are sent. |
subprotocol |
string | The subprotocol. |
Returns: WebRtcDataChannelBase<TDataChannel>
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:67
+ new WebRtcDataChannelBase<TDataChannel>(label
: string, ordered
: boolean, subprotocol
: string, internalChannel
: boolean): WebRtcDataChannelBase<TDataChannel>
Initializes a new instance of the [[fm.liveswitch.dataChannelBase]] class.
Type parameters:
Name |
---|
TDataChannel |
Parameters:
Name | Type | Description |
---|---|---|
label |
string | The label. |
ordered |
boolean | Whether messages will be delivered in the order they are sent. |
subprotocol |
string | The subprotocol. |
internalChannel |
boolean | Indicates whether this is an internal channel. |
Returns: WebRtcDataChannelBase<TDataChannel>
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:76
Methods
addOnStateChange
▸ addOnStateChange(value
: IAction1<TDataChannel>): void
Adds a handler that is raised when the data channel state changes.
Parameters:
Name | Type |
---|---|
value |
IAction1<TDataChannel> |
Returns: void
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:146
fmliveswitchWebRtcDataChannelBaseInit
▸ Private
fmliveswitchWebRtcDataChannelBaseInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:58
getBytesReceived
▸ getBytesReceived(): number
Gets the number of bytes received.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:158
getBytesSent
▸ getBytesSent(): number
Gets the number of bytes sent.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:170
getConnectionId
▸ getConnectionId(): string
Gets the connection identifier.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:182
getDynamicProperties
▸ getDynamicProperties(): Hash<string, Object>
Gets all dynamic properties on this instance.
Returns: Hash<string, Object>
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:37
getDynamicValue
▸ getDynamicValue(key
: string): Object
Gets a property value from the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: Object
The stored value, if found; otherwise null.
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:58
getId
▸ getId(): string
Gets the identifier.
Returns: string
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:202
getInfo
▸ getInfo(): DataChannelInfo
Gets the data channel info.
Returns: DataChannelInfo
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:214
getInstance
▸ Protected
Abstract
getInstance(): TDataChannel
Gets the current instance.
Returns: TDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:231
getIsInternal
▸ getIsInternal(): boolean
Gets a value indicating if this is an internal data channel.
Returns: boolean
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:237
getIsTerminated
▸ getIsTerminated(): boolean
Gets a value indicating whether the data channel is currently closed or failed.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:250
getIsTerminating
▸ getIsTerminating(): boolean
Gets a value indicating whether the data channel is currently closing.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:262
getIsTerminatingOrTerminated
▸ getIsTerminatingOrTerminated(): boolean
Gets a value indicating whether the data channel is currently closing, closed, or failed.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:274
getLabel
▸ getLabel(): string
Gets the label.
Returns: string
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:286
getMessagesReceived
▸ getMessagesReceived(): number
Gets the number of messages received.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:298
getMessagesSent
▸ getMessagesSent(): number
Gets the number of messages sent.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:310
getOnReceive
▸ getOnReceive(): IAction1<DataChannelReceiveArgs>
Gets a callback invoked when a message is received.
TypeScript Example:
channel.setOnReceive((messageArgs) => {
// Do something
});
Returns: IAction1<DataChannelReceiveArgs>
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:330
getOrdered
▸ getOrdered(): boolean
Gets a value indicating whether messages will be delivered in the order they are sent.
Returns: boolean
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:342
getState
▸ getState(): DataChannelState
Gets the state.
Returns: DataChannelState
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:354
getStreamId
▸ getStreamId(): string
Gets the stream identifier.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:374
getSubprotocol
▸ getSubprotocol(): string
Gets the subprotocol.
Returns: string
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:386
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:10
processStateChange
▸ Protected
processStateChange(): void
Processes a state change.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:437
processStateLockChange
▸ Protected
processStateLockChange(): void
Processes a state lock change.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:448
raiseDataBytes
▸ Protected
raiseDataBytes(dataBytes
: DataBuffer): void
Raises the OnReceive callback with data bytes.
Parameters:
Name | Type | Description |
---|---|---|
dataBytes |
DataBuffer | The data bytes. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:464
raiseDataString
▸ Protected
raiseDataString(dataString
: string): void
Raises the OnReceive callback with a data string.
Parameters:
Name | Type | Description |
---|---|---|
dataString |
string | The data string. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:500
registerDataReceived
▸ Protected
registerDataReceived(dataLength
: number): void
Registers that a data has been sent.
Parameters:
Name | Type | Description |
---|---|---|
dataLength |
number | The data length. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:530
registerDataSent
▸ Protected
registerDataSent(dataLength
: number): void
Registers that a data has been sent.
Parameters:
Name | Type | Description |
---|---|---|
dataLength |
number | The data length. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:549
removeOnStateChange
▸ removeOnStateChange(value
: IAction1<TDataChannel>): void
Removes a handler that is raised when the data channel state changes.
Parameters:
Name | Type |
---|---|
value |
IAction1<TDataChannel> |
Returns: void
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:583
sendDataBytes
▸ Abstract
sendDataBytes(dataBytes
: DataBuffer): Future<Object>
Sends some bytes.
Parameters:
Name | Type | Description |
---|---|---|
dataBytes |
DataBuffer | The data bytes. |
Returns: Future<Object>
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:596
sendDataString
▸ Abstract
sendDataString(dataString
: string): Future<Object>
Sends a string.
Parameters:
Name | Type | Description |
---|---|---|
dataString |
string | The data string. |
Returns: Future<Object>
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:603
setDynamicValue
▸ setDynamicValue(key
: string, value
: Object): void
Sets a property value in the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
value |
Object | The property value. This can be any object that needs to be stored for future use. |
Returns: void
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:95
setOnReceive
▸ setOnReceive(value
: IAction1<DataChannelReceiveArgs>): void
Sets a callback invoked when a message is received.
TypeScript Example:
channel.setOnReceive((messageArgs) => {
// Do something
});
Parameters:
Name | Type |
---|---|
value |
IAction1<DataChannelReceiveArgs> |
Returns: void
Implementation of: IDataChannel
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcDataChannelBase.ts:641
unsetDynamicValue
▸ unsetDynamicValue(key
: string): boolean
Removes a property value from the local cache. Returns true if the value was removed and returns false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: boolean
true
if the value was removed; otherwise, false
.
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:122