Example #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);
        }
Example #2
0
 public FlightsDemo(Channel channel)
 {
     // init client
     client = new Flights.FlightsClient(channel);
 }
 public GrpcFlightsController(IGrpcController grpcController, IMapper mapper)
 {
     _mapper         = mapper;
     _grpcController = grpcController;
     flightsClient   = grpcController.GetFlightsClient();
 }