docs.unity3d.com
    Show / Hide Table of Contents

    Interface IChannel

    Channel object. Use CreateChannel(IChannelTokenProvider) to construct one. This object allows the subscription to a channel.

    Namespace: Unity.Services.Wire.Internal
    Syntax
    public interface IChannel : IDisposable

    Methods

    SubscribeAsync()

    SubscribeAsync will subscribe to the channel. Possible error codes are:

    • 23002 -> "CommandFailed"
    • 23003 -> "ConnectionFailed"
    • 23004 -> "InvalidToken"
    • 23005 -> "InvalidChannelName"
    • 23006 -> "TokenRetrieverFailed"
    • 23007 -> "Unauthorized"
    • 23008 -> "AlreadySubscribed"
    Declaration
    Task SubscribeAsync()
    Returns
    Type Description
    Task

    An awaitable task.

    UnsubscribeAsync()

    UnsubscribeAsync will stop the subscription, effective immediately. Possible error codes are:

    • 23002 -> "CommandFailed"
    • 23009 -> "AlreadyUnsubscribed"
    Declaration
    Task UnsubscribeAsync()
    Returns
    Type Description
    Task

    An awaitable task.

    Events

    BinaryMessageReceived

    Handler called each time the channel receives a binary message.

    Declaration
    event Action<byte[]> BinaryMessageReceived
    Event Type
    Type Description
    Action<Byte[]>

    ErrorReceived

    Handler called whenever the subscription encounters an error. A description of the error is passed as an argument.

    Declaration
    event Action<string> ErrorReceived
    Event Type
    Type Description
    Action<String>

    KickReceived

    Handler called if the subscription gets terminated by the Wire server.

    Declaration
    event Action KickReceived
    Event Type
    Type Description
    Action

    MessageReceived

    Handler called each time the channel receives a message.

    Declaration
    event Action<string> MessageReceived
    Event Type
    Type Description
    Action<String>

    NewStateReceived

    Handler called whenever the subscription reliability changes.

    Declaration
    event Action<SubscriptionState> NewStateReceived
    Event Type
    Type Description
    Action<SubscriptionState>
    Back to top
    Terms of use
    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