mirror of https://github.com/grpc/grpc.git
The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
https://grpc.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
617 B
26 lines
617 B
10 years ago
|
using System;
|
||
|
using Grpc.Core;
|
||
|
using helloworld;
|
||
|
|
||
|
namespace GreeterClient
|
||
|
{
|
||
|
class ClientMainClass
|
||
|
{
|
||
|
public static void Main(string[] args)
|
||
|
{
|
||
|
GrpcEnvironment.Initialize();
|
||
|
|
||
|
using (Channel channel = new Channel("127.0.0.1:50051"))
|
||
|
{
|
||
|
var client = Greeter.NewStub(channel);
|
||
|
String user = "you";
|
||
|
|
||
|
var reply = client.SayHello(new HelloRequest.Builder { Name = user }.Build());
|
||
|
Console.WriteLine("Greeting: " + reply.Message);
|
||
|
}
|
||
|
|
||
|
GrpcEnvironment.Shutdown();
|
||
|
}
|
||
|
}
|
||
|
}
|