Class WebRTCDataChannel

Definition

Namespace:
Tizen.Multimedia.Remoting
Assembly:
Tizen.Multimedia.Remoting.dll
API Level:
9

Provides the ability to control WebRTC data channel.

C#
Copy
public class WebRTCDataChannel : IDisposable
Inheritance
System.Object
WebRTCDataChannel
Implements
System.IDisposable

Constructors

View Source

WebRTCDataChannel(WebRTC, String)

Initializes a new instance of the WebRTCDataChannel class.

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

The owner of this WebRTCDataChannel.

System.String label

The name of this data channel.

Exceptions
Type Condition
System.ArgumentNullException

The webRtc or label is null.

API Level: 9
View Source

WebRTCDataChannel(WebRTC, String, Bundle)

Initializes a new instance of the WebRTCDataChannel class.

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

The owner of this WebRTCDataChannel.

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

API Level: 9

Properties

View Source

BufferedAmount

Gets the amount of buffered data.

Declaration
C#
Copy
public uint BufferedAmount { get; }
Property Value
Type Description
System.UInt32

The buffered amount in bytes.

Exceptions
Type Condition
ObjectDisposedException

The WebRTCDataChannel has already been disposed.

API Level: 10
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
C#
Copy
public uint BufferedAmountLowThreshold { get; set; }
Property Value
Type Description
System.UInt32
Exceptions
Type Condition
ObjectDisposedException

The WebRTCDataChannel has already been disposed.

API Level: 10
View Source

Label

Gets the label of this data channel.

Declaration
C#
Copy
public string Label { get; }
Property Value
Type Description
System.String

The label.

API Level: 9

Methods

View Source

Dispose()

Releases all resources used by the current instance.

Declaration
C#
Copy
public void Dispose()
API Level: 9
View Source

Send(Byte[])

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

Declaration
C#
Copy
public void Send(byte[] data)
Parameters
Type Name Description
System.Byte[] data

The byte data to send

Exceptions
Type Condition
ObjectDisposedException

The WebRTCDataChannel has already been disposed.

API Level: 9
View Source

Send(String)

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

Declaration
C#
Copy
public void Send(string data)
Parameters
Type Name Description
System.String data

The string data to send

Exceptions
Type Condition
ObjectDisposedException

The WebRTCDataChannel has already been disposed.

API Level: 9

Events

View Source

BufferedAmountLow

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

Declaration
C#
Copy
public event EventHandler<EventArgs> BufferedAmountLow
Event Type
Type Description
System.EventHandler<EventArgs>
API Level: 10
View Source

Closed

Occurs when the data channel has closed down.

Declaration
C#
Copy
public event EventHandler<EventArgs> Closed
Event Type
Type Description
System.EventHandler<EventArgs>
API Level: 9
View Source

ErrorOccurred

Occurs when an error occurs on the data channel.

Declaration
C#
Copy
public event EventHandler<WebRTCDataChannelErrorOccurredEventArgs> ErrorOccurred
Event Type
Type Description
System.EventHandler<WebRTCDataChannelErrorOccurredEventArgs>
API Level: 9
View Source

MessageReceived

Occurs when a message is received from the remote peer.

Declaration
C#
Copy
public event EventHandler<WebRTCDataChannelMessageReceivedEventArgs> MessageReceived
Event Type
Type Description
System.EventHandler<WebRTCDataChannelMessageReceivedEventArgs>
API Level: 9
View Source

Opened

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

Declaration
C#
Copy
public event EventHandler<EventArgs> Opened
Event Type
Type Description
System.EventHandler<EventArgs>
API Level: 9

Implements

System.IDisposable