Esempio n. 1
0
 // 实现SayHello方法
 public override Task <HelloReply> SayHello(HelloRequest request, ServerCallContext context)
 {
     return(Task.FromResult(new HelloReply {
         Message = "Hello " + request.Name
     }));
 }
 public override Task <HelloReply> SayHello(HelloRequest request, ServerCallContext context)
 {
     return(Task.FromResult(new HelloReply {
         Message = $"Hello {request.Name}! The time on this server is { DateTime.Now}"
     }));
 }
Esempio n. 3
0
 public override async Task SayHelloAgain(HelloRequest request, IServerStreamWriter <HelloReply> responseStream, ServerCallContext context)
 {
     await responseStream.WriteAsync(new HelloReply { Message = "Hello " + request.Name });
 }
Esempio n. 4
0
 // Server side handler of the SayHello RPC
 public override async Task <HelloReply> SayHello(HelloRequest request, ServerCallContext context)
 {
     return(new HelloReply {
         Message = "Hello " + request.Name
     });
 }