Example #1
0
        static void Main(string[] args)
        {
            Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure);

            var client = new HelloWorld.HelloWorldClient(channel);
            var reply  = client.SayHello(new HelloRequest {
                Name = "codeyu"
            });

            Console.WriteLine("Greeting: " + reply.Message);

            channel.ShutdownAsync().Wait();
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
Example #2
0
        private static void TestHelloWorld(Channel channel)
        {
            var    client = new HelloWorld.HelloWorldClient(channel);
            String user   = "******";

            var helloRequest = new HelloRequest {
                Name = user
            };

            HelloReply reply = client.SayHello(helloRequest);

            Console.WriteLine("Greeting: " + reply.Message);

            reply = client.SayHelloAgain(helloRequest);
            Console.WriteLine("Greeting: " + reply.Message);
        }