docs.unity3d.com
    Show / Hide Table of Contents

    Interface IServiceMessagingClient

    Interface for a messaging client used to connect to a service and send/receive messages

    Namespace: Unity.Cloud.Common
    Syntax
    public interface IServiceMessagingClient

    Properties

    State

    Reference to the current state of the connection

    Declaration
    ConnectionState State { get; }
    Property Value
    Type Description
    ConnectionState

    Methods

    AddApiSourceVersion(String, String)

    Adds an ApiSourceVersion to the client.

    Declaration
    void AddApiSourceVersion(string name, string version)
    Parameters
    Type Name Description
    String name

    The API source name.

    String version

    The API source version.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown is name or version are null or whitespace.

    AddApiSourceVersion(ApiSourceVersion)

    Adds an ApiSourceVersion to the client.

    Declaration
    void AddApiSourceVersion(ApiSourceVersion apiSourceVersion)
    Parameters
    Type Name Description
    ApiSourceVersion apiSourceVersion

    The version information for the API using this client.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if apiSourceVersion is null or any of its fields are null or whitespace.

    ConnectAsync(Uri, ServiceMessagingClientOptions, CancellationToken)

    Awaitable method to open a connection to a service using the given url using messaging client options

    Declaration
    Task ConnectAsync(Uri uri, ServiceMessagingClientOptions options = default(ServiceMessagingClientOptions), CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Uri uri

    Uri

    ServiceMessagingClientOptions options

    The selected options

    CancellationToken cancellationToken

    Optional cancellation token that will try to cancel the operation.

    Returns
    Type Description
    Task

    DisconnectAsync()

    Awaitable method to close a connection to a server

    Declaration
    Task DisconnectAsync()
    Returns
    Type Description
    Task

    SendAsync(IEnumerable<Message>)

    Awaitable method to send a collection of messages to a server

    Declaration
    Task SendAsync(IEnumerable<Message> messages)
    Parameters
    Type Name Description
    IEnumerable<Message> messages
    Returns
    Type Description
    Task

    SendAsync(Message)

    Awaitable method to send a message to a server

    Declaration
    Task SendAsync(Message message)
    Parameters
    Type Name Description
    Message message
    Returns
    Type Description
    Task

    Events

    ConnectionErrorOccured

    Event invoked when a connection error occurs

    Declaration
    event Action<Exception> ConnectionErrorOccured
    Event Type
    Type Description
    Action<Exception>

    ConnectionStateChanged

    Event invoked when the client's connection state changes

    Declaration
    event Action<ConnectionState> ConnectionStateChanged
    Event Type
    Type Description
    Action<ConnectionState>

    MessageReceived

    Event invoked when a message is received from the server

    Declaration
    event Action<Message> MessageReceived
    Event Type
    Type Description
    Action<Message>

    Extension Methods

    IServiceMessagingClientExtensions.AddApiSourceVersionFromAssembly(IServiceMessagingClient, Assembly)
    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