docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IChannel

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

    Inherited Members
    IDisposable.Dispose()
    Namespace: Unity.Services.Wire.Internal
    Assembly: Unity.Services.Core.Internal.dll
    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>
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)