Exemple #1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, PublisherServerBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_Ping, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PingRequest, global::AckMessage>(serviceImpl.Ping));
     serviceBinder.AddMethod(__Method_ReceiveChain, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ChainMessage, global::AckMessage>(serviceImpl.ReceiveChain));
     serviceBinder.AddMethod(__Method_ReceiveTransaction, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::TransactionMessage, global::AckMessage>(serviceImpl.ReceiveTransaction));
     serviceBinder.AddMethod(__Method_RegisterNode, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ServerAddressMessage, global::AckMessage>(serviceImpl.RegisterNode));
     serviceBinder.AddMethod(__Method_RequestDeltaChain, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::DeltaRequest, global::ChainMessage>(serviceImpl.RequestDeltaChain));
     serviceBinder.AddMethod(__Method_RequestFullChain, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ServerAddressMessage, global::ChainMessage>(serviceImpl.RequestFullChain));
     serviceBinder.AddMethod(__Method_RequestNodes, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ServerAddressMessage, global::ServerAddressMessageList>(serviceImpl.RequestNodes));
     serviceBinder.AddMethod(__Method_RequestPendingPhysicians, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ServerAddressMessage, global::PhysicianMessageList>(serviceImpl.RequestPendingPhysicians));
 }
Exemple #2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(PublisherServerBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Ping, serviceImpl.Ping)
            .AddMethod(__Method_ReceiveChain, serviceImpl.ReceiveChain)
            .AddMethod(__Method_ReceiveTransaction, serviceImpl.ReceiveTransaction)
            .AddMethod(__Method_RegisterNode, serviceImpl.RegisterNode)
            .AddMethod(__Method_RequestDeltaChain, serviceImpl.RequestDeltaChain)
            .AddMethod(__Method_RequestFullChain, serviceImpl.RequestFullChain)
            .AddMethod(__Method_RequestNodes, serviceImpl.RequestNodes)
            .AddMethod(__Method_RequestPendingPhysicians, serviceImpl.RequestPendingPhysicians).Build());
 }