Exemplo n.º 1
0
        private static async Task <int> StartRegistrationProcess(string regists)
        {
            var count = 0;

            var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client  = new Greeter.GreeterClient(channel);
            var reply   = await client.RegisterApplicationsAsync(
                new RegistrationRequest { RegistrationList = regists });

            Console.WriteLine("Greeting: " + reply.NoProcessed);
            count = int.Parse(reply.NoProcessed);

            return(count);
        }
Exemplo n.º 2
0
        private static Task StartUnaryRegistrationProcess(Registration regist)
        {
            var count = 0;

            var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client  = new Greeter.GreeterClient(channel);
            var reply   = client.RegisterApplicationsAsync(
                new RegistrationRequest());


            Console.WriteLine("Greeting: " + reply.ResponseAsync.Result.NoProcessed);
            count = int.Parse(reply.ResponseAsync.Result.NoProcessed);

            return(Task.CompletedTask);
        }