/// <inheritdoc/> public void Start(EndpointVisibility type, EndpointConfiguration configuration, IEnumerable <Service> services) { try { var keepAliveTime = new grpc.ChannelOption("grpc.keepalive_time", 1000); var keepAliveTimeout = new grpc.ChannelOption("grpc.keepalive_timeout_ms", 500); var keepAliveWithoutCalls = new grpc.ChannelOption("grpc.keepalive_permit_without_calls", 1); _server = new grpc::Server(new[] { keepAliveTime, keepAliveTimeout, keepAliveWithoutCalls }) { Ports = { new grpc.ServerPort("0.0.0.0", configuration.Port, grpc::SslServerCredentials.Insecure) } }; _server .Ports .ForEach(_ => _logger.Information($"Starting {type} host on {_.Host}" + (_.Port > 0 ? $" for port {_.Port}" : string.Empty))); services.ForEach(_ => _server.Services.Add(_.ServerDefinition)); _server.Start(); } catch (Exception ex) { _logger.Error(ex, $"Couldn't start {type} host"); } }
/// <inheritdoc/> public void Start() { try { _server .Ports .ForEach(_ => _logger.Information($"Starting interaction server on {_.Host}" + (_.Port > 0 ? $" for port {_.Port}" : string.Empty))); _server.Start(); _logger.Information("Interaction server is running"); } catch (Exception ex) { _logger.Error(ex, "Couldn't not start interaction server"); } }