Interface IPeerConnectionDataChannelConnector

The peer connection data channel connector interface.

interface IPeerConnectionDataChannelConnector {
    bufferedAmount: number;
    bufferedAmountLowThreshold: number;
    onBufferedAmountLow: null | (() => void);
    onClose: null | (() => void);
    onMessage: null | ((message: MessageEvent<any>) => void);
    state: string;
    close(): void;
    send(data: string): void;
    send(data: ArrayBuffer): void;
}

Properties

bufferedAmount: number

The current buffered amount.

bufferedAmountLowThreshold: number

The low threshold for the buffered amount.

onBufferedAmountLow: null | (() => void)

The callback for when the buffered amount is low.

onClose: null | (() => void)

The callback for when the data channel closes.

onMessage: null | ((message: MessageEvent<any>) => void)

The callback for when a message is received on the data channel.

state: string

The current state of the data channel.

Methods

  • Closes the data channel.

    Returns void

  • Sends data on the data channel.

    Parameters

    • data: string

      The data to send.

    Returns void

  • Sends data on the data channel.

    Parameters

    Returns void