Пример #1
0
    static void SetupChannelClient()
    {
        const bool autoTick = true;

        if (s_BinaryClient == null)
        {
            s_BinaryClient = ChannelClient.GetOrCreateClient("custom_binary_ping_pong");
            s_BinaryClient.Start(autoTick);
            s_DisconnectBinaryClient = s_BinaryClient.On(HandleClientBinaryMessage);
        }
        Debug.Log($"[Step3] Setup client for channel custom_binary_ping_pong. ClientId: {s_BinaryClient.clientId}");

        if (s_StringClient == null)
        {
            s_StringClient = ChannelClient.GetOrCreateClient("custom_ascii_ping_pong");
            s_StringClient.Start(autoTick);
            s_DisconnectStringClient = s_StringClient.On(HandleClientStringMessage);
        }
        Debug.Log($"[Step3] Setup client for channel custom_ascii_ping_pong. ClientId: {s_StringClient.clientId}");
    }