Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebRtcDataChannel

Hierarchy

  • WebRtcDataChannelBase<WebRtcDataChannel>
    • WebRtcDataChannel

Implements

  • IDataChannel<WebRtcDataChannel>
  • IInternalDataChannel

Index

Constructors

constructor

  • new WebRtcDataChannel(external: IExternalDataChannel, label: string, ordered?: boolean, subprotocol?: string): WebRtcDataChannel
  • Parameters

    • external: IExternalDataChannel
    • label: string
    • Optional ordered: boolean
    • Optional subprotocol: string

    Returns WebRtcDataChannel

Properties

Private _external

_external: IExternalDataChannel
internal

Private _nativeDataChannel

_nativeDataChannel: RTCDataChannel
internal

Methods

_getExternal

  • _getExternal(): IExternalDataChannel
  • internal

    Returns IExternalDataChannel

addOnStateChange

  • addOnStateChange(value: IAction1<WebRtcDataChannel>): void
  • Adds a handler that is raised when the state changes.

    Parameters

    • value: IAction1<WebRtcDataChannel>

    Returns void

getDynamicProperties

  • getDynamicProperties(): Hash<string, Object>
  • Gets the dynamic properties on this instance.

    Returns Hash<string, Object>

getDynamicValue

  • getDynamicValue(key: string): Object
  • Gets a property value from the local cache.

    Parameters

    • 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.

getId

  • getId(): string
  • Gets the identifier.

    Returns string

getInstance

  • getInstance(): WebRtcDataChannel
  • Returns WebRtcDataChannel

getIsDirty

  • getIsDirty(): boolean
  • Gets a value indicating whether this instance is dirty.
    internal

    Returns boolean

getIsSerialized

  • getIsSerialized(): boolean

getLabel

  • getLabel(): string
  • Gets the label.

    Returns string

getNativeDataChannel

  • getNativeDataChannel(): RTCDataChannel
  • Returns RTCDataChannel

getOnReceive

  • getOnReceive(): IAction1<DataChannelReceiveArgs>
  • Gets the callback to execute when a message is received.

    Returns IAction1<DataChannelReceiveArgs>

getOrdered

  • getOrdered(): boolean
  • Gets a value indicating whether messages will be delivered in the order they are sent.

    Returns boolean

getSerialized

  • getSerialized(): string

getState

  • getState(): DataChannelState
  • Gets the state.

    Returns DataChannelState

getSubprotocol

  • getSubprotocol(): string
  • Gets the subprotocol.

    Returns string

getTypeString

  • getTypeString(): string
  • Returns string

Protected raiseDataBytes

  • raiseDataBytes(dataBytes: DataBuffer): void
  • Raises the OnReceive callback with data bytes.

    Parameters

    • dataBytes: DataBuffer

      The data bytes.

    Returns void

Protected raiseDataString

  • raiseDataString(dataString: string): void
  • Raises the OnReceive callback with a data string.

    Parameters

    • dataString: string

      The data string.

    Returns void

removeOnStateChange

  • removeOnStateChange(value: IAction1<WebRtcDataChannel>): void
  • Removes a handler that is raised when the state changes.

    Parameters

    • value: IAction1<WebRtcDataChannel>

    Returns void

sendDataBytes

  • sendDataBytes(dataBytes: DataBuffer): void
  • Parameters

    • dataBytes: DataBuffer

    Returns void

sendDataString

  • sendDataString(dataString: string): void
  • Parameters

    • dataString: string

    Returns void

setDynamicProperties

  • setDynamicProperties(value: Hash<string, Object>): void
  • internal

    Parameters

    • value: Hash<string, Object>

    Returns void

setDynamicValue

  • setDynamicValue(key: string, value: Object): void
  • Sets a property value in the local cache.

    Parameters

    • 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

setId

  • setId(value: string): void
  • Sets the identifier.

    Parameters

    • value: string

    Returns void

setIsDirty

  • setIsDirty(value: boolean): void
  • Sets a value indicating whether this instance is dirty.
    internal

    Parameters

    • value: boolean

    Returns void

setIsSerialized

  • setIsSerialized(value: boolean): void
  • internal

    Parameters

    • value: boolean

    Returns void

setNativeDataChannel

  • setNativeDataChannel(nativeDataChannel: RTCDataChannel): void
  • Parameters

    • nativeDataChannel: RTCDataChannel

    Returns void

setOnReceive

  • setOnReceive(value: IAction1<DataChannelReceiveArgs>): void
  • Sets the callback to execute when a message is received.

    Parameters

    • value: IAction1<DataChannelReceiveArgs>

    Returns void

setSerialized

  • setSerialized(value: string): void
  • internal

    Parameters

    • value: string

    Returns void

Protected setState

  • setState(value: DataChannelState): void
  • Sets the state.

    Parameters

    • value: DataChannelState

    Returns void

unsetDynamicValue

  • unsetDynamicValue(key: string): boolean
  • Unsets a property value in the local cache.

    Parameters

    • 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.

updateInternalLock

  • updateInternalLock(): void
  • Returns void

updateState

  • updateState(value: DataChannelState): void
  • Parameters

    • value: DataChannelState

    Returns void