OLD | NEW |
(Empty) | |
| 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 // source: helloworld.proto |
| 3 #region Designer generated code |
| 4 |
| 5 using System; |
| 6 using System.Threading; |
| 7 using System.Threading.Tasks; |
| 8 using Grpc.Core; |
| 9 |
| 10 namespace Helloworld { |
| 11 public static class Greeter |
| 12 { |
| 13 static readonly string __ServiceName = "helloworld.Greeter"; |
| 14 |
| 15 static readonly Marshaller<global::Helloworld.HelloRequest> __Marshaller_Hel
loRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtension
s.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); |
| 16 static readonly Marshaller<global::Helloworld.HelloReply> __Marshaller_Hello
Reply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.To
ByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); |
| 17 |
| 18 static readonly Method<global::Helloworld.HelloRequest, global::Helloworld.H
elloReply> __Method_SayHello = new Method<global::Helloworld.HelloRequest, globa
l::Helloworld.HelloReply>( |
| 19 MethodType.Unary, |
| 20 __ServiceName, |
| 21 "SayHello", |
| 22 __Marshaller_HelloRequest, |
| 23 __Marshaller_HelloReply); |
| 24 |
| 25 // service descriptor |
| 26 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descripto
r |
| 27 { |
| 28 get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0
]; } |
| 29 } |
| 30 |
| 31 // client interface |
| 32 public interface IGreeterClient |
| 33 { |
| 34 global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest req
uest, Metadata headers = null, DateTime? deadline = null, CancellationToken canc
ellationToken = default(CancellationToken)); |
| 35 global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest req
uest, CallOptions options); |
| 36 AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Hellow
orld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, C
ancellationToken cancellationToken = default(CancellationToken)); |
| 37 AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Hellow
orld.HelloRequest request, CallOptions options); |
| 38 } |
| 39 |
| 40 // server-side interface |
| 41 public interface IGreeter |
| 42 { |
| 43 Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloReque
st request, ServerCallContext context); |
| 44 } |
| 45 |
| 46 // client stub |
| 47 public class GreeterClient : ClientBase, IGreeterClient |
| 48 { |
| 49 public GreeterClient(Channel channel) : base(channel) |
| 50 { |
| 51 } |
| 52 public global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequ
est request, Metadata headers = null, DateTime? deadline = null, CancellationTok
en cancellationToken = default(CancellationToken)) |
| 53 { |
| 54 var call = CreateCall(__Method_SayHello, new CallOptions(headers, deadli
ne, cancellationToken)); |
| 55 return Calls.BlockingUnaryCall(call, request); |
| 56 } |
| 57 public global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequ
est request, CallOptions options) |
| 58 { |
| 59 var call = CreateCall(__Method_SayHello, options); |
| 60 return Calls.BlockingUnaryCall(call, request); |
| 61 } |
| 62 public AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global:
:Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline =
null, CancellationToken cancellationToken = default(CancellationToken)) |
| 63 { |
| 64 var call = CreateCall(__Method_SayHello, new CallOptions(headers, deadli
ne, cancellationToken)); |
| 65 return Calls.AsyncUnaryCall(call, request); |
| 66 } |
| 67 public AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global:
:Helloworld.HelloRequest request, CallOptions options) |
| 68 { |
| 69 var call = CreateCall(__Method_SayHello, options); |
| 70 return Calls.AsyncUnaryCall(call, request); |
| 71 } |
| 72 } |
| 73 |
| 74 // creates service definition that can be registered with a server |
| 75 public static ServerServiceDefinition BindService(IGreeter serviceImpl) |
| 76 { |
| 77 return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 78 .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); |
| 79 } |
| 80 |
| 81 // creates a new client |
| 82 public static GreeterClient NewClient(Channel channel) |
| 83 { |
| 84 return new GreeterClient(channel); |
| 85 } |
| 86 |
| 87 } |
| 88 } |
| 89 #endregion |
OLD | NEW |