使用 ASP.NET Core 3.0 在 Kestrel Web 服务器中禁用 Nagle 算法
Disabling Nagle algorithm in Kestrel Web Server with ASP.NET Core 3.0
ListenOptions.NoDelay is removed and not available in .NET Core 3.0 anymore. In the documentation for migrating to 3.0 (https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio#transport-abstractions-moved-and-made-public) 它说:
NoDelay was moved from ListenOptions to the transport options.
但它没有显示如何实施此更改。
如何在 .NET Core 3.0 中将 NoDelay
选项设置为 false?谢谢!
添加对
的包引用
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv" Version="3.0.0" />
并调用:
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.UseLibuv(opts =>{
opts.NoDelay = false;
})
.UseStartup<Startup>();
});
上的官方文档
ListenOptions.NoDelay is removed and not available in .NET Core 3.0 anymore. In the documentation for migrating to 3.0 (https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio#transport-abstractions-moved-and-made-public) 它说:
NoDelay was moved from ListenOptions to the transport options.
但它没有显示如何实施此更改。
如何在 .NET Core 3.0 中将 NoDelay
选项设置为 false?谢谢!
添加对
的包引用<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv" Version="3.0.0" />
并调用:
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.UseLibuv(opts =>{
opts.NoDelay = false;
})
.UseStartup<Startup>();
});
上的官方文档