Hi!
Yes, timeout and keepalive are the same.
I also tried to move out one and the issue keeps the same.
The weird thing is when I start the service it starts to log this connection/disconnection loop, and I'm not making any calls to the API (not sure what is the relation of this connections). If I try to call a test method, a http connection is created and this connection is keeping alive until the default value (that is 2 minutes) and this is ok.
This is the Configure and ConfigureServices method:
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddMvc().AddNewtonsoftJson(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddLog4Net();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseCors(x => x.SetIsOriginAllowed(_ => true).AllowAnyMethod().AllowAnyHeader().AllowCredentials());
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
And this is the Program class:
class Program
{
public static IConfiguration Configuration { get; set; }
static void Main(string[] args)
{
Configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json", false, true).Build();
var pathToExe = Process.GetCurrentProcess().MainModule.FileName;
var pathToContentRoot = Path.GetDirectoryName(pathToExe);
var host = CreateHostBuilder(args, pathToContentRoot);
host.Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args, string pathToContentRoot) =>
Host.CreateDefaultBuilder(args)
.UseSystemd()
.UseWindowsService()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseContentRoot(pathToContentRoot)
.UseConfiguration(Configuration)
.UseStartup<Startup>();
});
}
Any other idea?
Thanks, regards!