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.
79 lines
3.1 KiB
79 lines
3.1 KiB
10 years ago
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||
|
// source: helloworld.proto
|
||
|
#region Designer generated code
|
||
|
|
||
|
using System;
|
||
|
using System.Threading;
|
||
|
using System.Threading.Tasks;
|
||
|
using Grpc.Core;
|
||
|
|
||
|
namespace helloworld {
|
||
|
public static class Greeter
|
||
|
{
|
||
|
static readonly string __ServiceName = "helloworld.Greeter";
|
||
|
|
||
10 years ago
|
static readonly Marshaller<global::helloworld.HelloRequest> __Marshaller_HelloRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::helloworld.HelloRequest.ParseFrom);
|
||
|
static readonly Marshaller<global::helloworld.HelloReply> __Marshaller_HelloReply = Marshallers.Create((arg) => arg.ToByteArray(), global::helloworld.HelloReply.ParseFrom);
|
||
10 years ago
|
|
||
10 years ago
|
static readonly Method<global::helloworld.HelloRequest, global::helloworld.HelloReply> __Method_SayHello = new Method<global::helloworld.HelloRequest, global::helloworld.HelloReply>(
|
||
10 years ago
|
MethodType.Unary,
|
||
|
"SayHello",
|
||
|
__Marshaller_HelloRequest,
|
||
|
__Marshaller_HelloReply);
|
||
|
|
||
|
// client-side stub interface
|
||
|
public interface IGreeterClient
|
||
|
{
|
||
10 years ago
|
global::helloworld.HelloReply SayHello(global::helloworld.HelloRequest request, CancellationToken token = default(CancellationToken));
|
||
|
Task<global::helloworld.HelloReply> SayHelloAsync(global::helloworld.HelloRequest request, CancellationToken token = default(CancellationToken));
|
||
10 years ago
|
}
|
||
|
|
||
|
// server-side interface
|
||
|
public interface IGreeter
|
||
|
{
|
||
10 years ago
|
Task<global::helloworld.HelloReply> SayHello(ServerCallContext context, global::helloworld.HelloRequest request);
|
||
10 years ago
|
}
|
||
|
|
||
|
// client stub
|
||
|
public class GreeterClient : AbstractStub<GreeterClient, StubConfiguration>, IGreeterClient
|
||
|
{
|
||
|
public GreeterClient(Channel channel) : this(channel, StubConfiguration.Default)
|
||
|
{
|
||
|
}
|
||
|
public GreeterClient(Channel channel, StubConfiguration config) : base(channel, config)
|
||
|
{
|
||
|
}
|
||
10 years ago
|
public global::helloworld.HelloReply SayHello(global::helloworld.HelloRequest request, CancellationToken token = default(CancellationToken))
|
||
10 years ago
|
{
|
||
|
var call = CreateCall(__ServiceName, __Method_SayHello);
|
||
|
return Calls.BlockingUnaryCall(call, request, token);
|
||
|
}
|
||
10 years ago
|
public Task<global::helloworld.HelloReply> SayHelloAsync(global::helloworld.HelloRequest request, CancellationToken token = default(CancellationToken))
|
||
10 years ago
|
{
|
||
|
var call = CreateCall(__ServiceName, __Method_SayHello);
|
||
|
return Calls.AsyncUnaryCall(call, request, token);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// creates service definition that can be registered with a server
|
||
|
public static ServerServiceDefinition BindService(IGreeter serviceImpl)
|
||
|
{
|
||
|
return ServerServiceDefinition.CreateBuilder(__ServiceName)
|
||
|
.AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
|
||
|
}
|
||
|
|
||
|
// creates a new client stub
|
||
|
public static IGreeterClient NewStub(Channel channel)
|
||
|
{
|
||
|
return new GreeterClient(channel);
|
||
|
}
|
||
|
|
||
|
// creates a new client stub
|
||
|
public static IGreeterClient NewStub(Channel channel, StubConfiguration config)
|
||
|
{
|
||
|
return new GreeterClient(channel, config);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
#endregion
|