Exemplo n.º 1
0
        private async Task InitializeClientAsync()
        {
            // Initialize the Hub
            this.channel = new Channel("localhost", 5000, ChannelCredentials.Insecure);
            // for SSL/TLS connection
            //var cred = new SslCredentials(File.ReadAllText(Path.Combine(Application.streamingAssetsPath, "server.crt")));
            //this.channel = new Channel("dummy.example.com", 5000, cred); // local tls
            //this.channel = new Channel("your-nlb-domain.com", 5000, new SslCredentials()); // aws nlb tls

            while (!shutdownCancellation.IsCancellationRequested)
            {
                try
                {
                    Debug.Log($"Connecting to the server...");
                    this.streamingClient = await StreamingHubClient.ConnectAsync <IChatHub, IChatHubReceiver>(this.channel, this, cancellationToken : shutdownCancellation.Token);

                    this.RegisterDisconnectEvent(streamingClient);
                    Debug.Log($"Connection is established.");
                    break;
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                }

                Debug.Log($"Failed to connect to the server. Retry after 5 seconds...");
                await Task.Delay(5 * 1000);
            }

            this.client = MagicOnionClient.Create <IChatService>(this.channel);
        }
Exemplo n.º 2
0
    public async Task <AuthRes> AutoLoginCheck()
    {
        if (userService == null)
        {
            userService = MagicOnionClient.Create <IUserService>(baseNetworkManager.ConnectChannel());
        }

        if (PlayerPrefs.HasKey(PREF_AUTH_USERID) && PlayerPrefs.HasKey(PREF_AUTH_PASSWORD))
        {
            string userId   = saveAES.Decrypt(PlayerPrefs.GetString(PREF_AUTH_USERID));
            string password = saveAES.Decrypt(PlayerPrefs.GetString(PREF_AUTH_PASSWORD));
            accessToken = await userService.LoginCheck(sendAES.Encrypt(userId), sendAES.Encrypt(password), (int)CheckMode.UserId);

            if (accessToken == "")
            {
                return(AuthRes.Failed);
            }
        }
        else
        {
            return(AuthRes.NoAccount);
        }

        return(AuthRes.Success);
    }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Client:::");

            //GrpcEnvironment.SetThreadPoolSize(1000);
            //GrpcEnvironment.SetCompletionQueueCount(1000);

            //Environment.SetEnvironmentVariable("GRPC_TRACE", "all");
            GrpcEnvironment.SetLogger(new ConsoleLogger());

            var channel = new Channel("localhost", 12345, ChannelCredentials.Insecure);

            channel.ConnectAsync().Wait();
            var c = MagicOnionClient.Create <IMyFirstService>(channel);

            // TestHeartbeat(channel).GetAwaiter().GetResult();
            //UnaryRun(c).GetAwaiter().GetResult();
            ClientStreamRun(c).GetAwaiter().GetResult();
            ServerStreamRun(c).GetAwaiter().GetResult();
            DuplexStreamRun(c).GetAwaiter().GetResult();

            // many run
            //UnaryLoadTest(c).GetAwaiter().GetResult();


            //HearbeatClient.Test(channel).GetAwaiter().GetResult();
            //Console.ReadLine();

            //ChatClient.Run(channel).GetAwaiter().GetResult();
            //TestHeartbeat(channel).GetAwaiter().GetResult();
        }
Exemplo n.º 4
0
        static async Task Main(string[] args)
        {
            using (var host = new HostBuilder()
                              .UseMagicOnion(
                       new ServerPort[] { new ServerPort("localhost", 10012, ServerCredentials.Insecure) },
                       searchAssemblies: new Assembly[] { Assembly.GetEntryAssembly() },
                       options: new MagicOnionOptions())
                              .Build())
            {
                host.Start();
                // client task
                var channel = new Channel("localhost", 10012, ChannelCredentials.Insecure);
                var client  = MagicOnionClient.Create <IMyService>(channel);
                for (int i = 0; i < 10; i++)
                {
                    var ret = await client.SumAsync(i, i * 2);

                    Console.WriteLine($"{i}, ret = {ret}");
                }
                // shutdown service when client task has done
                Console.WriteLine($"shutdown task");
                await host.StopAsync();

                // test for safe if multiple stop call.
                await host.StopAsync();

                Console.WriteLine($"all task done");
            }
        }
Exemplo n.º 5
0
        public GrpcRemoteSearchDirector(string host, int port)
        {
            this._channel = new Channel(host, port, ChannelCredentials.Insecure);

            string hostName = null;

            try
            {
                hostName = Environment.MachineName;
            }
            catch (InvalidOperationException) { }

            // ConnectionId を設定する
            this._channelContext = new ChannelContext(this._channel);

            var headers = new Metadata()
            {
                { ChannelContext.HeaderKey, this._channelContext.ConnectionId }
            };

            if (!string.IsNullOrEmpty(hostName))
            {
                headers.Add(GrpcAsheServerContract.HostNameHeader, hostName);
            }

            // ChannelContext.CreateClient には IFormatterResolver を指定できるオーバーロードがないので、自分でヘッダーを設定
            this._service = MagicOnionClient.Create <IAsheMagicOnionService>(this._channel, WhcFormatterResolver.Instance)
                            .WithHeaders(headers);
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Initialize();

            Console.WriteLine("Hello World!");

            var _loadBalancerHouse = serviceProvider.GetRequiredService <ILoadBalancerHouse>();
            var _rpcChannelFactory = serviceProvider.GetRequiredService <IGrpcChannelFactory>();
            // 服务发现地址
            var endpoints = _loadBalancerHouse.Get("Bucket.Grpc.Server").Result;
            var endpoint  = endpoints.Lease().Result;
            var channel   = _rpcChannelFactory.Get(endpoint.Address, endpoint.Port);
            // var channel = _rpcChannelFactory.Get("10.10.133.235", 5004);
            var hello     = MagicOnionClient.Create <IHello>(channel);
            var StartTime = DateTime.Now;

            for (var i = 0; i < 10000; i++)
            {
                hello = MagicOnionClient.Create <IHello>(channel);
                var result = hello.Hello("haha test").GetAwaiter().GetResult();
                Console.WriteLine($"grpc 请求结果:{result}");
            }
            var TimeLength = Math.Round((DateTime.Now - StartTime).TotalMilliseconds, 4);

            Console.WriteLine("GRPC 10000次请求耗时" + TimeLength + "毫秒");
            Console.ReadLine();
        }
Exemplo n.º 7
0
        public async Task DuplexStreaming()
        {
            var client = MagicOnionClient.Create <ISimpleTest>(channel);
            {
                var r = await client.DuplexStreaming1Task();

                await r.RequestStream.WriteAsync(1000);

                await r.ResponseStream.MoveNext();

                r.ResponseStream.Current.Is("1000");

                await r.RequestStream.WriteAsync(2000);

                await r.ResponseStream.MoveNext();

                r.ResponseStream.Current.Is("1000, 2000");

                await r.RequestStream.WriteAsync(3000);

                await r.ResponseStream.MoveNext();

                r.ResponseStream.Current.Is("1000, 2000, 3000");

                await r.RequestStream.CompleteAsync();

                (await r.ResponseStream.MoveNext()).IsFalse();
            }
            {
                var r = client.DuplexStreaming1();
                (await r.ResponseStream.MoveNext()).IsFalse();
            }
        }
Exemplo n.º 8
0
        public async UnaryResult <Nil> SendReportAsync(string message)
        {
            logger.LogDebug($"{message}");

            // dummy external operation.
            using (var activity = this.mysqlActivity.StartActivity("report/insert", ActivityKind.Internal))
            {
                // this is sample. use orm or any safe way.
                activity?.SetTag("service.name", options.ServiceName);
                activity?.SetTag("table", "report");
                activity?.SetTag("query", $"INSERT INTO report VALUES ('foo', 'bar');");
                await Task.Delay(TimeSpan.FromMilliseconds(2));
            }

            // Server to Server operation
            var channel = GrpcChannel.ForAddress(Environment.GetEnvironmentVariable("Server2ServerEndpoint", EnvironmentVariableTarget.Process) ?? "http://localhost:4999");
            var client  = MagicOnionClient.Create <IMessageService>(channel, new[]
            {
                // propagate trace context from ChatApp.Server to MicroServer
                new MagicOnionOpenTelemetryClientFilter(s2sActivity, options),
            });
            await client.SendAsync("hello");

            // dummy external operation.
            using (var activity = this.mysqlActivity.StartActivity("report/get", ActivityKind.Internal))
            {
                // this is sample. use orm or any safe way.
                activity?.SetTag("service.name", options.ServiceName);
                activity?.SetTag("table", "report");
                activity?.SetTag("query", $"INSERT INTO report VALUES ('foo', 'bar');");
                await Task.Delay(TimeSpan.FromMilliseconds(1));
            }

            return(Nil.Default);
        }
Exemplo n.º 9
0
        public async ValueTask <ResponseContext> SendAsync(RequestContext context, Func <RequestContext, ValueTask <ResponseContext> > next)
        {
            if (AuthenticationTokenStorage.Current.IsExpired)
            {
                Console.WriteLine($@"[WithAuthenticationFilter/IAccountService.SignInAsync] Try signing in as '{_signInId}'... ({(AuthenticationTokenStorage.Current.Token == null ? "FirstTime" : "RefreshToken")})");

                var client     = MagicOnionClient.Create <IAccountService>(_channel);
                var authResult = await client.SignInAsync(_signInId, _password);

                if (!authResult.Success)
                {
                    throw new Exception("Failed to sign-in on the server.");
                }
                Console.WriteLine($@"[WithAuthenticationFilter/IAccountService.SignInAsync] User authenticated as {authResult.Name} (UserId:{authResult.UserId})");

                AuthenticationTokenStorage.Current.Update(authResult.Token, authResult.Expiration); // NOTE: You can also read the token expiration date from JWT.

                context.CallOptions.Headers.Remove(new Metadata.Entry("Authorization", string.Empty));
            }

            if (!context.CallOptions.Headers.Contains(new Metadata.Entry("Authorization", string.Empty)))
            {
                context.CallOptions.Headers.Add("Authorization", "Bearer " + AuthenticationTokenStorage.Current.Token);
            }

            return(await next(context));
        }
Exemplo n.º 10
0
        public GrpcRemoteWagahighOperator(string host, int port)
        {
            this._channel = new Channel(host, port, ChannelCredentials.Insecure);
            this._service = MagicOnionClient.Create <IToaMagicOnionService>(this._channel, WhcFormatterResolver.Instance);

            this.LogStream = Observable.Create <string>(async(observer, cancellationToken) =>
            {
                using (var result = await this._service.LogStream().ConfigureAwait(false))
                    using (cancellationToken.Register(result.Dispose))
                    {
                        var stream = result.ResponseStream;

                        // MoveNext に CancellationToken を指定するのは対応していない
                        while (true)
                        {
                            if (cancellationToken.IsCancellationRequested)
                            {
                                return;
                            }
                            if (!await stream.MoveNext().ConfigureAwait(false))
                            {
                                break;
                            }
                            observer.OnNext(stream.Current);
                        }
                    }

                observer.OnCompleted();
            });
        }
Exemplo n.º 11
0
        public static void AddMagicOnion(this IServiceCollection services, IConfiguration appConfig)
        {
            if (services == null)
            {
                throw new ArgumentNullException("services");
            }

            if (appConfig == null)
            {
                throw new ArgumentNullException("appConfig");
            }

            services.ConfigureSection <MagicOnionSettings>(appConfig, "MagicOnion");

            services.AddScoped(svcProv =>
            {
                var channel = svcProv.GetService <Channel>();
                return(MagicOnionClient.Create <ISimpleService>(channel));
            });

            services.AddSingleton(svcProv =>
            {
                var opts = svcProv.GetOptions <MagicOnionSettings>();
                return(new Channel(opts.GrpcServerHost, opts.GrpcServerPort, ChannelCredentials.Insecure));
            });
        }
Exemplo n.º 12
0
        public async Task <IActionResult> Test()
        {
            var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var service = MagicOnionClient.Create <IGreeterService>(channel);

            return(Content(await service.HelloAsync()));
        }
Exemplo n.º 13
0
        static async Task RunAsync(string endpoint, int port, string prefix, ChannelOption[] options)
        {
            var channel = new Channel(endpoint, port, ChannelCredentials.Insecure, options);
            var client  = MagicOnionClient.Create <IEchoService>(new DefaultCallInvoker(channel));
            var reply   = await client.EchoAsync("hogemoge");

            Console.WriteLine("Echo: " + reply);

            // duplex
            var receiver  = new MyHubReceiver();
            var hubClient = await StreamingHubClient.ConnectAsync <IMyHub, IMyHubReceiver>(new DefaultCallInvoker(channel), receiver);

            var roomPlayers = await hubClient.JoinAsync($"room {prefix}", "hoge");

            foreach (var player in roomPlayers)
            {
                receiver.OnJoin(player);
            }

            var i = 0;

            while (i++ < 100)
            {
                await hubClient.SendAsync($"{prefix} {i}");

                await Task.Delay(TimeSpan.FromSeconds(60));
            }
            await hubClient.LeaveAsync();

            await hubClient.DisposeAsync();

            await channel.ShutdownAsync();
        }
Exemplo n.º 14
0
 private void InitializeClient()
 {
     // Initialize the Hub
     this.channel         = new Channel("localhost:12345", ChannelCredentials.Insecure);
     this.streamingClient = StreamingHubClient.Connect <IChatHub, IChatHubReceiver>(this.channel, this);
     this.client          = MagicOnionClient.Create <IChatService>(this.channel);
 }
Exemplo n.º 15
0
        private async Task InitializeClientAsync()
        {
            // Initialize the Hub
            // NOTE: If you want to use SSL/TLS connection, see InitialSettings.OnRuntimeInitialize method.
            this.channel = GrpcChannelx.ForAddress("http://localhost:5000");

            while (!shutdownCancellation.IsCancellationRequested)
            {
                try
                {
                    Debug.Log($"Connecting to the server...");
                    this.streamingClient = await StreamingHubClient.ConnectAsync <IChatHub, IChatHubReceiver>(this.channel, this, cancellationToken : shutdownCancellation.Token);

                    this.RegisterDisconnectEvent(streamingClient);
                    Debug.Log($"Connection is established.");
                    break;
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                }

                Debug.Log($"Failed to connect to the server. Retry after 5 seconds...");
                await Task.Delay(5 * 1000);
            }

            this.client = MagicOnionClient.Create <IChatService>(this.channel);
        }
Exemplo n.º 16
0
        public TService GetRemoteServiceForDirectConnection <TService>(string serviceName) where TService : IService <TService>
        {
            var nodeInfo = GrpcClientConfiguration.GrpcDirectConnectionConfiguration[serviceName];

            if (nodeInfo == null)
            {
                throw new CafException("Grpc 服务没有在启动时定义,或者初始化内部 Channel 失败.");
            }

            if (nodeInfo.InternalChannel != null)
            {
                //if (typeof(IServiceMarker).IsAssignableFrom(typeof(TService)))
                //{
                //    //ClientCreate.MakeGenericMethod(new Type[] { typeof(TService) });
                //    return (TService)ClientCreate.MakeGenericMethod(new Type[] { typeof(TService) }).Invoke(null, new object[] { nodeInfo.InternalChannel }); //MagicOnionClient.Create<TService>(nodeInfo.InternalChannel);
                //}
                //else
                //{
                //    if(TypeMapping.ContainsKey(typeof(TService)))
                //    {
                //        return (TService)ClientCreate.MakeGenericMethod(new Type[] { TypeMapping[typeof(TService)] }).Invoke(null, new object[] { nodeInfo.InternalChannel });
                //    }
                //    //ClientCreate.MakeGenericMethod(new Type[] { typeof(TService) });
                //}
                return(MagicOnionClient.Create <TService>(nodeInfo.InternalChannel));
            }

            throw new CafException("无法创建 Grpc 服务.");
        }
Exemplo n.º 17
0
        public void Initialize(
            CommandLineOptions options,
            PrivateKey privateKey,
            Action <bool> callback)
        {
            PrivateKey = privateKey;

            _channel = new Channel(
                options.RpcServerHost,
                options.RpcServerPort,
                ChannelCredentials.Insecure,
                new[]
            {
                new ChannelOption("grpc.max_receive_message_length", -1)
            }
                );
            _lastTipChangedAt = DateTimeOffset.UtcNow;
            _hub     = StreamingHubClient.Connect <IActionEvaluationHub, IActionEvaluationHubReceiver>(_channel, this);
            _service = MagicOnionClient.Create <IBlockChainService>(_channel);

            _genesis = BlockManager.ImportBlock(options.GenesisBlockPath ?? BlockManager.GenesisBlockPath);
            var appProtocolVersion = options.AppProtocolVersion is null
                ? default
                : Libplanet.Net.AppProtocolVersion.FromToken(options.AppProtocolVersion);

            AppProtocolVersion = appProtocolVersion.Version;

            RegisterDisconnectEvent(_hub);
            StartCoroutine(CoTxProcessor());
            StartCoroutine(CoJoin(callback));
        }
 public TarefaController(IConfiguration configuration)
 {
     _tarefaGrpcService     = MagicOnionClient.Create <ITarefaGrpcService>(CreateAuthenticatedChannel(configuration["AppSettings:UrlCpnucleoGrpcTarefa"]));
     _sistemaGrpcService    = MagicOnionClient.Create <ISistemaGrpcService>(CreateAuthenticatedChannel(configuration["AppSettings:UrlCpnucleoGrpcSistema"]));
     _projetoGrpcService    = MagicOnionClient.Create <IProjetoGrpcService>(CreateAuthenticatedChannel(configuration["AppSettings:UrlCpnucleoGrpcProjeto"]));
     _workflowGrpcService   = MagicOnionClient.Create <IWorkflowGrpcService>(CreateAuthenticatedChannel(configuration["AppSettings:UrlCpnucleoGrpcWorkflow"]));
     _tipoTarefaGrpcService = MagicOnionClient.Create <ITipoTarefaGrpcService>(CreateAuthenticatedChannel(configuration["AppSettings:UrlCpnucleoGrpcTipoTarefa"]));
 }
Exemplo n.º 19
0
        static void Main(string[] args)
        {
            _channel = new Channel("localhost", 12345, ChannelCredentials.Insecure);

            // get MagicOnion dynamic client proxy
            _client = MagicOnionClient.Create <IMyFirstService>(_channel);
            testy();
        }
Exemplo n.º 20
0
        public Task <TService> GetRemoteService <TService>(string serviceName, int servicePort)
            where TService : IService <TService>
        {
            var channel = _grpcChannelFactory.Get(serviceName, servicePort);
            var service = MagicOnionClient.Create <TService>(channel);

            return(Task.FromResult(service));
        }
Exemplo n.º 21
0
        public static T Create <T>() where T : IService <T>
        {
            var channel = new Channel(endPoint, 12345, ChannelCredentials.Insecure);

            var client = MagicOnionClient.Create <T>(channel).WithDeadline(DateTime.UtcNow.AddSeconds(10));

            return(client);
        }
Exemplo n.º 22
0
        public async Task Unary4()
        {
            var client = MagicOnionClient.Create <IArgumentPattern>(channel);

            var result = await client.Unary4();

            result.Should().Be(Nil.Default);
        }
Exemplo n.º 23
0
        public T GetServ <T>(params object[] paramArray) where T : IMicServ <T>
        {
            string address = paramArray == null || paramArray.Length == 0 ? micServClientSettings.Address : paramArray[0].ToString();

            GrpcChannel channel = GrpcChannel.ForAddress(address);
            var         target  = MagicOnionClient.Create <T>(channel);

            return(target);
        }
Exemplo n.º 24
0
        /// <summary>
        /// <see cref="UnarySequentialDispatcherRemoteNode{TInput}"/>
        /// </summary>
        /// <param name="persistentCache">Persistent cache to avoid dropped data on system crash</param>
        /// <param name="progress">Progress of the current bulk</param>
        /// <param name="host"><see cref="Host"/></param>
        /// <param name="cts"><see cref="CancellationTokenSource"/></param>
        /// <param name="circuitBreakerOptions"><see cref="CircuitBreakerOptions"/></param>
        /// <param name="clusterOptions"><see cref="ClusterOptions"/></param>
        /// <param name="logger"><see cref="ILogger"/></param>
        public UnarySequentialDispatcherRemoteNode(
            IAppCache persistentCache,
            IProgress <double> progress,
            Host host,
            CancellationTokenSource cts,
            CircuitBreakerOptions circuitBreakerOptions,
            ClusterOptions clusterOptions,
            ILogger logger) : base(
                Policy.Handle <Exception>()
                .AdvancedCircuitBreakerAsync(circuitBreakerOptions.CircuitBreakerFailureThreshold,
                                             circuitBreakerOptions.CircuitBreakerSamplingDuration,
                                             circuitBreakerOptions.CircuitBreakerMinimumThroughput,
                                             circuitBreakerOptions.CircuitBreakerDurationOfBreak,
                                             onBreak: (ex, timespan, context) =>
        {
            logger.LogError(
                $"Batch processor breaker: Breaking the circuit for {timespan.TotalMilliseconds}ms due to {ex.Message}.");
        },
                                             onReset: context =>
        {
            logger.LogInformation(
                "Batch processor breaker: Succeeded, closed the circuit.");
        },
                                             onHalfOpen: () =>
        {
            logger.LogWarning(
                "Batch processor breaker: Half-open, next call is a trial.");
        }), clusterOptions, progress, cts, logger)
        {
            _logger         = logger;
            _clusterOptions = clusterOptions;

            ISubject <PersistentItem <TInput> > dispatcherSubject = new Subject <PersistentItem <TInput> >();
            _synchronizedDispatcherSubject             = Subject.Synchronize(dispatcherSubject);
            _synchronizedDispatcherSubjectSubscription = _synchronizedDispatcherSubject
                                                         .ObserveOn(new EventLoopScheduler(ts => new Thread(ts)))
                                                         .Select(item =>
            {
                return(Observable.FromAsync(() => persistentCache.AddItemAsync(item.Entity,
                                                                               item.CancellationTokenSource.Token)));
            })
                                                         .Merge()
                                                         .Subscribe();

            var channel = new Channel(host.MachineName, host.Port,
                                      ChannelCredentials.Insecure);
            _remoteContract = MagicOnionClient.Create <IRemoteContract <TInput> >(channel);
            IRemoteNodeSubject nodeReceiver = new NodeReceiver(_logger);
            _remoteNodeHealthSubscription =
                nodeReceiver.RemoteNodeHealthSubject.Subscribe(remoteNodeHealth =>
            {
                NodeMetrics.RemoteNodeHealth = remoteNodeHealth;
            });
            _nodeHub = StreamingHubClient.Connect <INodeHub, INodeReceiver>(channel, (INodeReceiver)nodeReceiver);

            NodeMetrics = new NodeMetrics(Guid.NewGuid());
        }
Exemplo n.º 25
0
        public async Task Unary5()
        {
            var client = MagicOnionClient.Create <IArgumentPattern>(channel);

            var result = await client.Unary5(new MyStructRequest(999, 9999));

            result.X.Should().Be(999);
            result.Y.Should().Be(9999);
        }
Exemplo n.º 26
0
        public async Task Unary3()
        {
            var client = MagicOnionClient.Create <IArgumentPattern>(channel);

            var result = await client.Unary3();

            result.Id.Should().Be(-1);
            result.Data.Should().Be("NoArg");
        }
Exemplo n.º 27
0
        public async Task Unary2()
        {
            var client = MagicOnionClient.Create <IArgumentPattern>(channel);

            var result = await client.Unary2(new MyRequest { Id = 30, Data = "huga" });

            result.Id.Should().Be(30);
            result.Data.Should().Be("huga");
        }
Exemplo n.º 28
0
        private static async Task MainAsync()
        {
            var channel = new Channel("localhost", 12345, ChannelCredentials.Insecure);
            var client  = MagicOnionClient.Create <ISampleApi>(channel);
            var result  = await client.Sum(100, 200);

            Console.WriteLine($"Result : {result}");
            Console.ReadLine();
        }
Exemplo n.º 29
0
        public static async Task MagicOnionSum()
        {
            var callInvoker = CreateCallInvoker();
            var calculator  = MagicOnionClient.Create <ICalculator>(callInvoker);

            var result = await calculator.Sum(1, 2);

            Console.WriteLine("MagicOnionSum 1 + 2 = " + result);
        }
        private void Awake()
        {
            if (GrpcChannel == null)
            {
                GrpcChannel = new Channel(connectionTarget, connectionPort, ChannelCredentials.Insecure);

                TestService = MagicOnionClient.Create <ITestService>(GrpcChannel);
            }
        }