aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/csharp/helloworld/GreeterClient/Program.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-28 16:15:22 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-09-02 12:58:44 -0700
commit8a937d6ed48275607ae5cc04c7d5147edf377a7e (patch)
tree49bfe6800470a94fc0dd466d21b9072e352c4380 /examples/csharp/helloworld/GreeterClient/Program.cs
parentdea2648a6acb5c16b158335b4deb02caf4f02487 (diff)
update helloworld example to proto3
Diffstat (limited to 'examples/csharp/helloworld/GreeterClient/Program.cs')
-rw-r--r--examples/csharp/helloworld/GreeterClient/Program.cs24
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();
+ }
+ }
+}