// Start is called before the first frame update void Start() { channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); var client = new User.UserClient(channel); var reply = client.SayHello(new UserRequest() { Name = "123456" }); Debug.Log("Greeting: " + reply.Message); // var client = new greeter // GreeterServer }
static void Main(string[] args) { Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); var client = new User.UserClient(channel); String user = "******"; var reply = client.SayHello(new UserRequest() { Name = user }); Console.WriteLine("Greeting: " + reply.Message); channel.ShutdownAsync().Wait(); Console.WriteLine("Press any key to exit..."); Console.ReadKey(); }