예제 #1
0
        public GrpcController()
        {
            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);

            GrpcChannel = GrpcChannel.ForAddress($"{GRPC_SERVER_PROTOCOL}://{GRPC_SERVER_HOST}:{GRPC_SERVER_PORT}", new GrpcChannelOptions
            {
                MaxReceiveMessageSize = 25 * 1024 * 1024, // ~26 MB
                MaxSendMessageSize    = 25 * 1024 * 1024  // ~26 MB
            });

            AirlinesClient = new Airlines.AirlinesClient(GrpcChannel);

            PlanesClient = new Planes.PlanesClient(GrpcChannel);

            WeathersClient = new Weathers.WeathersClient(GrpcChannel);

            FlightsClient = new Flights.FlightsClient(GrpcChannel);
        }
 public GrpcWeatherController(IGrpcController grpcController, IMapper mapper)
 {
     _mapper         = mapper;
     _grpcController = grpcController;
     weathersClient  = grpcController.GetWeathersClient();
 }