KestrelServerOptions Class

Provides programmatic configuration of Kestrel-specific features.

Namespace
Microsoft.AspNetCore.Server.Kestrel
Assemblies
  • Microsoft.AspNetCore.Server.Kestrel

Syntax

public class KestrelServerOptions
class Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions

Properties

Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions.AddServerHeader

Gets or sets whether the <code>Server</code> header should be included in each response.

Return type:System.Boolean
public bool AddServerHeader { get; set; }
Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions.ApplicationServices

Enables the UseKestrel options callback to resolve and use services registered by the application during startup. Typically initialized by Microsoft.AspNetCore.Hosting.WebHostBuilderKestrelExtensions.UseKestrel(Microsoft.AspNetCore.Hosting.IWebHostBuilder,System.Action{Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions}).

Return type:System.IServiceProvider
public IServiceProvider ApplicationServices { get; set; }
Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions.ConnectionFilter

Gets or sets an Microsoft.AspNetCore.Server.Kestrel.Filter.IConnectionFilter that allows each connection System.IO.Stream to be intercepted and transformed. Configured by the <code>UseHttps()</code> and Microsoft.AspNetCore.Hosting.KestrelServerOptionsConnectionLoggingExtensions.UseConnectionLogging(Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions) extension methods.

Return type:Microsoft.AspNetCore.Server.Kestrel.Filter.IConnectionFilter
public IConnectionFilter ConnectionFilter { get; set; }
Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions.MaxRequestBufferSize

Maximum size of the request buffer. If value is null, the size of the request buffer is unlimited.

Return type:System.Nullable<System.Int64>
public long ? MaxRequestBufferSize { get; set; }
Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions.NoDelay

Set to false to enable Nagle’s algorithm for all connections.

Return type:System.Boolean
public bool NoDelay { get; set; }
Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions.ShutdownTimeout

The amount of time after the server begins shutting down before connections will be forcefully closed. Kestrel will wait for the duration of the timeout for any ongoing request processing to complete before terminating the connection. No new connections or requests will be accepted during this time.

Return type:System.TimeSpan
public TimeSpan ShutdownTimeout { get; set; }
Microsoft.AspNetCore.Server.Kestrel.KestrelServerOptions.ThreadCount

The number of libuv I/O threads used to process requests.

Return type:System.Int32
public int ThreadCount { get; set; }