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
-
objectWebRTCDataChannel
- Implements
-
System.IDisposable
Constructors
View SourceWebRTCDataChannel(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. |
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 SourceLabel
Gets the label of this data channel.
Declaration
public string Label { get; }
Property Value
Type | Description |
---|---|
string | The label. |
Methods
View SourceDispose()
Releases all resources used by the current instance.
Declaration
public void Dispose()
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. |
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 SourceClosed
Occurs when the data channel has closed down.
Declaration
public event EventHandler<EventArgs> Closed
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><System.EventArgs> |
ErrorOccurred
Occurs when an error occurs on the data channel.
Declaration
public event EventHandler<WebRTCDataChannelErrorOccurredEventArgs> ErrorOccurred
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><WebRTCDataChannelErrorOccurredEventArgs> |
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> |
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> |