Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var channel = new Channel("127.0.0.1:50052", ChannelCredentials.Insecure);

            var client = new helloMessage.helloMessageClient(channel);

            Hi hi1 = client.GetFeature(new Hi()
            {
                Count = 100, Say = "Hello 100"
            });

            Console.WriteLine($"Hi count:{hi1.Count},say:{hi1.Say}.");

            Hi hi2 = client.GetFeatureAsync(new Hi()
            {
                Count = 400, Say = "Hello 400"
            }).ResponseAsync.Result;

            Console.WriteLine($"Hi count:{hi2.Count},say:{hi2.Say}.");

            ListPerson2(client).Wait();

            ListPerson4(client).Wait();

            channel.ShutdownAsync().Wait();
            Console.WriteLine("Press any key to exit...");
            //var client = new RouteGuideClient(new Hello.RouteGuideClient(channel));

            Console.Read();
        }