diff options
author | 2015-08-28 16:15:22 -0700 | |
---|---|---|
committer | 2015-09-02 12:58:44 -0700 | |
commit | 8a937d6ed48275607ae5cc04c7d5147edf377a7e (patch) | |
tree | 49bfe6800470a94fc0dd466d21b9072e352c4380 /examples/csharp/helloworld/GreeterClient/Program.cs | |
parent | dea2648a6acb5c16b158335b4deb02caf4f02487 (diff) |
update helloworld example to proto3
Diffstat (limited to 'examples/csharp/helloworld/GreeterClient/Program.cs')
-rw-r--r-- | examples/csharp/helloworld/GreeterClient/Program.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/csharp/helloworld/GreeterClient/Program.cs b/examples/csharp/helloworld/GreeterClient/Program.cs new file mode 100644 index 0000000000..279cee07e1 --- /dev/null +++ b/examples/csharp/helloworld/GreeterClient/Program.cs @@ -0,0 +1,24 @@ +using System; +using Grpc.Core; +using Helloworld; + +namespace GreeterClient +{ + class Program + { + public static void Main(string[] args) + { + Channel channel = new Channel("127.0.0.1:50051", Credentials.Insecure); + + var client = Greeter.NewClient(channel); + String user = "you"; + + var reply = client.SayHello(new HelloRequest { Name = user }); + Console.WriteLine("Greeting: " + reply.Message); + + channel.ShutdownAsync().Wait(); + Console.WriteLine("Press any key to exit..."); + Console.ReadKey(); + } + } +} |