Class WebRTCDataChannel

    Definition

    Namespace:
    Tizen.Multimedia.Remoting
    Assembly:
    Tizen.Multimedia.Remoting.dll

    Provides the ability to control WebRTC data channel.

    public class WebRTCDataChannel : IDisposable
    Inheritance
    object
    WebRTCDataChannel
    Implements
    System.IDisposable

    Constructors

    View Source

    WebRTCDataChannel(WebRTC, string, Bundle)

    Initializes a new instance of the WebRTCDataChannel class.

    Declaration
    public WebRTCDataChannel(WebRTC webRtc, string label, Bundle bundle)
    Parameters
    Type Name Description
    WebRTC webRtc

    The owner of this WebRTCDataChannel.

    string label

    The name of this data channel.

    Bundle bundle

    The data channel option.

    Remarks

    The bundle is similar format as the RTCDataChannelInit members outlined https://www.w3.org/TR/webrtc/#dom-rtcdatachannelinit.
    The following attributes can be set to options by using Bundle API:
    'ordered' of type bool : Whether the channel will send data with guaranteed ordering. The default value is true.
    'max-packet-lifetime' of type int : The time in milliseconds to attempt transmitting unacknowledged data. -1 for unset. The default value is -1.
    'max-retransmits' of type int : The number of times data will be attempted to be transmitted without acknowledgement before dropping. The default value is -1.
    'protocol' of type string : The subprotocol used by this channel. The default value is NULL.
    'id' of type int : Override the default identifier selection of this channel. The default value is -1.
    'priority' of type int : The priority to use for this channel(1:very low, 2:low, 3:medium, 4:high). The default value is 2.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The webRtc or label is null.

    View Source

    WebRTCDataChannel(WebRTC, string)

    Initializes a new instance of the WebRTCDataChannel class.

    Declaration
    public WebRTCDataChannel(WebRTC webRtc, string label)
    Parameters
    Type Name Description
    WebRTC webRtc

    The owner of this WebRTCDataChannel.

    string label

    The name of this data channel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The webRtc or label is null.

    Properties

    View Source

    BufferedAmount

    Gets the amount of buffered data.

    Declaration
    public uint BufferedAmount { get; }
    Property Value
    Type Description
    uint

    The buffered amount in bytes.

    Exceptions
    Type Condition
    System.ObjectDisposedException

    The WebRTCDataChannel has already been disposed.

    View Source

    BufferedAmountLowThreshold

    Gets or sets the threshold of data channel buffered amount.
    If the amount of buffered data is lower than threshold value, BufferedAmountLow will be occurred.
    The default value is 0, which means BufferedAmountLow is disabled and will not be raised.

    Declaration
    public uint BufferedAmountLowThreshold { get; set; }
    Property Value
    Type Description
    uint
    Exceptions
    Type Condition
    System.ObjectDisposedException

    The WebRTCDataChannel has already been disposed.

    View Source

    Label

    Gets the label of this data channel.

    Declaration
    public string Label { get; }
    Property Value
    Type Description
    string

    The label.

    Methods

    View Source

    Dispose()

    Releases all resources used by the current instance.

    Declaration
    public void Dispose()
    View Source

    Send(byte[])

    Sends byte data across the data channel to the remote peer.

    Declaration
    public void Send(byte[] data)
    Parameters
    Type Name Description
    byte[] data

    The byte data to send

    Exceptions
    Type Condition
    System.ObjectDisposedException

    The WebRTCDataChannel has already been disposed.

    View Source

    Send(string)

    Sends a string data across the data channel to the remote peer.

    Declaration
    public void Send(string data)
    Parameters
    Type Name Description
    string data

    The string data to send

    Exceptions
    Type Condition
    System.ObjectDisposedException

    The WebRTCDataChannel has already been disposed.

    Events

    View Source

    BufferedAmountLow

    Occurs when the buffered data amount is lower than BufferedAmountLowThreshold.
    If BufferedAmountLowThreshold is not set, this event will not be registered.

    Declaration
    public event EventHandler<EventArgs> BufferedAmountLow
    Event Type
    Type Description
    System.EventHandler<TEventArgs><System.EventArgs>
    View Source

    Closed

    Occurs when the data channel has closed down.

    Declaration
    public event EventHandler<EventArgs> Closed
    Event Type
    Type Description
    System.EventHandler<TEventArgs><System.EventArgs>
    View Source

    ErrorOccurred

    Occurs when an error occurs on the data channel.

    Declaration
    public event EventHandler<WebRTCDataChannelErrorOccurredEventArgs> ErrorOccurred
    Event Type
    Type Description
    System.EventHandler<TEventArgs><WebRTCDataChannelErrorOccurredEventArgs>
    View Source

    MessageReceived

    Occurs when a message is received from the remote peer.

    Declaration
    public event EventHandler<WebRTCDataChannelMessageReceivedEventArgs> MessageReceived
    Event Type
    Type Description
    System.EventHandler<TEventArgs><WebRTCDataChannelMessageReceivedEventArgs>
    View Source

    Opened

    Occurs when the data channel's underlying data transport is established.

    Declaration
    public event EventHandler<EventArgs> Opened
    Event Type
    Type Description
    System.EventHandler<TEventArgs><System.EventArgs>

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX