Esempio n. 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, HandlerServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_AddInbound, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::V2Ray.Core.App.Proxyman.Command.AddInboundRequest, global::V2Ray.Core.App.Proxyman.Command.AddInboundResponse>(serviceImpl.AddInbound));
     serviceBinder.AddMethod(__Method_RemoveInbound, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::V2Ray.Core.App.Proxyman.Command.RemoveInboundRequest, global::V2Ray.Core.App.Proxyman.Command.RemoveInboundResponse>(serviceImpl.RemoveInbound));
     serviceBinder.AddMethod(__Method_AlterInbound, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::V2Ray.Core.App.Proxyman.Command.AlterInboundRequest, global::V2Ray.Core.App.Proxyman.Command.AlterInboundResponse>(serviceImpl.AlterInbound));
     serviceBinder.AddMethod(__Method_AddOutbound, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::V2Ray.Core.App.Proxyman.Command.AddOutboundRequest, global::V2Ray.Core.App.Proxyman.Command.AddOutboundResponse>(serviceImpl.AddOutbound));
     serviceBinder.AddMethod(__Method_RemoveOutbound, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::V2Ray.Core.App.Proxyman.Command.RemoveOutboundRequest, global::V2Ray.Core.App.Proxyman.Command.RemoveOutboundResponse>(serviceImpl.RemoveOutbound));
     serviceBinder.AddMethod(__Method_AlterOutbound, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::V2Ray.Core.App.Proxyman.Command.AlterOutboundRequest, global::V2Ray.Core.App.Proxyman.Command.AlterOutboundResponse>(serviceImpl.AlterOutbound));
 }
Esempio n. 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(HandlerServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_AddInbound, serviceImpl.AddInbound)
            .AddMethod(__Method_RemoveInbound, serviceImpl.RemoveInbound)
            .AddMethod(__Method_AlterInbound, serviceImpl.AlterInbound)
            .AddMethod(__Method_AddOutbound, serviceImpl.AddOutbound)
            .AddMethod(__Method_RemoveOutbound, serviceImpl.RemoveOutbound)
            .AddMethod(__Method_AlterOutbound, serviceImpl.AlterOutbound).Build());
 }