docs.unity.cn
    Show / Hide Table of Contents

    Class QosService

    Provides an entry point to the QoS Service, enabling clients to measure the quality of service (QoS) in terms of latency and packet loss for various regions.

    Inheritance
    Object
    QosService
    Namespace: Unity.Services.Qos
    Syntax
    public static class QosService
    Examples
    using System;
    using Unity.Services.Authentication;
    using Unity.Services.Core;
    using Unity.Services.Qos;
    using UnityEngine;
    
    namespace MyPackage
    {
        public class MySample : MonoBehaviour
        {
            public async void RunQos()
            {
                try
                {
                    await UnityServices.InitializeAsync();
                    await AuthenticationService.Instance.SignInAnonymouslyAsync();
                    var serviceName = "multiplay";
                    var qosResults = await QosService.Instance.GetSortedQosResultsAsync(serviceName, null);
                }
                catch (Exception e)
                {
                    Debug.Log(e);
                }
            }
        }
    }

    Properties

    Instance

    A static instance of the QoS Service.

    Declaration
    public static IQosService Instance { get; }
    Property Value
    Type Description
    IQosService
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, August 9, 2022
    Terms of use