Class RTCDataChannel | WebRTC | 2.1.3-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class RTCDataChannel

    Inheritance
    Object
    RTCDataChannel
    Namespace: Unity.WebRTC
    Syntax
    public class RTCDataChannel : IDisposable

    Properties

    Id

    Declaration
    public int Id { get; }
    Property Value
    Type Description
    Int32

    Label

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

    OnClose

    Declaration
    public DelegateOnClose OnClose { get; set; }
    Property Value
    Type Description
    DelegateOnClose

    OnMessage

    Declaration
    public DelegateOnMessage OnMessage { get; set; }
    Property Value
    Type Description
    DelegateOnMessage

    OnOpen

    Declaration
    public DelegateOnOpen OnOpen { get; set; }
    Property Value
    Type Description
    DelegateOnOpen

    ReadyState

    The property returns an enum of the RTCDataChannelState which shows the state of the channel.

    Declaration
    public RTCDataChannelState ReadyState { get; }
    Property Value
    Type Description
    RTCDataChannelState
    Remarks

    Send(String) method must be called when the state is Open.

    See Also
    RTCDataChannelState

    Methods

    Close()

    Declaration
    public void Close()

    Dispose()

    Declaration
    public void Dispose()

    Finalize()

    Declaration
    protected void Finalize()

    Send(Byte[])

    The method Sends data across the data channel to the remote peer.

    Declaration
    public void Send(byte[] msg)
    Parameters
    Type Name Description
    Byte[] msg
    Exceptions
    Type Condition
    InvalidOperationException

    The method throws InvalidOperationException when ReadyState is not Open.

    See Also
    ReadyState

    Send(String)

    The method Sends data across the data channel to the remote peer.

    Declaration
    public void Send(string msg)
    Parameters
    Type Name Description
    String msg
    Exceptions
    Type Condition
    InvalidOperationException

    The method throws InvalidOperationException when ReadyState is not Open.

    See Also
    ReadyState
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023