Ejemplo n.º 1
0
 public GrpcServer Start()
 {
     GrpcHandlerDirector.ConfigActor();
     foreach (var grpcServiceType in _builder.Services)
     {
         var grpcService = (IGrpcServices)GrpcServerBuilder.ServiceProvider.GetService(grpcServiceType);
         var definition  = grpcService.BindServices();
         definition = ResolveInterceptors(definition);
         _server.Services.Add(definition);
     }
     _server.Start();
     return(this);
 }
Ejemplo n.º 2
0
        public static Configuration StartGrpcServer(this Configuration configuration)
        {
            GrpcHandlerDirector.ConfigActor();

            var setting = configuration.Setting.GetGrpcServerSetting();
            var server  = ObjectContainer.Resolve <Server>();

            if (server.Ports.Count() == 0)
            {
                server.Ports.Add(new ServerPort(setting.Host, setting.Port, ServerCredentials.Insecure));
            }
            if (server.Services.Count() == 0)
            {
                server.Services.Add(ObjectContainer.Resolve <IGrpcServices>().BindServices());
            }
            server.Start();
            _messages = null;

            ObjectContainer.Resolve <ServiceRegister>().Register();
            return(configuration);
        }
Ejemplo n.º 3
0
 public GrpcServer Start()
 {
     GrpcHandlerDirector.ConfigActor();
     _server.Start();
     return(this);
 }