public GrpcEngine(string engine) { // maxRpcMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) var maxRpcMessageSize = 400 * 1024 * 1024; var grpcChannelOptions = new List <ChannelOption> { new ChannelOption(ChannelOptions.MaxReceiveMessageLength, maxRpcMessageSize) }; this._engine = new Engine.EngineClient(new Channel(engine, ChannelCredentials.Insecure, grpcChannelOptions)); }
public GrpcEngine(string engineAddress) { // Allow for insecure HTTP/2 transport (only needed for netcoreapp3.x) // https://docs.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-6.0#call-insecure-grpc-services-with-net-core-client AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); // maxRpcMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) const int maxRpcMessageSize = 400 * 1024 * 1024; if (_engineChannels.TryGetValue(engineAddress, out var engineChannel)) { // A channel already exists for this address this._engine = new Engine.EngineClient(engineChannel); } else { lock (_channelsLock) { if (_engineChannels.TryGetValue(engineAddress, out var existingChannel)) { // A channel already exists for this address this._engine = new Engine.EngineClient(existingChannel); } else { // Inititialize the engine channel once for this address var channel = GrpcChannel.ForAddress(new Uri($"http://{engineAddress}"), new GrpcChannelOptions { MaxReceiveMessageSize = maxRpcMessageSize, MaxSendMessageSize = maxRpcMessageSize, Credentials = Grpc.Core.ChannelCredentials.Insecure, }); _engineChannels[engineAddress] = channel; this._engine = new Engine.EngineClient(channel); } } } }
public Logger(IDeploymentInternal deployment, Engine.EngineClient engine) { _deployment = deployment; _engine = engine; }
public GrpcEngine(string engine) { this._engine = new Engine.EngineClient(new Channel(engine, ChannelCredentials.Insecure)); }