c# - 停止 Kestrel 服务器接受来自代码的请求

标签 c# asp.net .net-core kestrel-http-server

我正在努力完成以下任务: 我有一个运行 gRPC 服务的 asp.net core 3.1。

在应用程序的生命周期中,我希望能够暂停/停止端点/服务器监听/接受请求,并在一段时间后恢复它。

只是为了澄清我不想停止这个过程

我找不到任何与之相关的 Kestrel 命令,我们将不胜感激

最佳答案

During the lifetime of the application I want to be able to Pause/Stop the endpoint/Server from listening/accepting requests and after a while resuming it.

这在今天是不可能的,但会在 5.0 中实现。我建议对这个问题发表评论 https://github.com/dotnet/aspnetcore/issues/21244

关于c# - 停止 Kestrel 服务器接受来自代码的请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60927447/

相关文章:

asp.net-core - .Net Core 如何在应用程序中的任何位置访问配置

C# 通用应用程序 : automatically scroll to bottom of textbox after setting new text programmatically

c# - 不想 JSON 序列化整个类列表

c# - asp.net中实现证书授权

asp.net - asp:Gridview中的LinkBut​​ton可以将音频文件从文件夹检索到html音频,以便可以播放

.net-core - 当在 6379 以外的端口上设置 Redis 时,.NET Core 无法在缓存中插入数据

.net-core - 在 Blazor .net 8 WebAssembly 上显示加载进度预渲染错误?

c# - 如何查看 UWP 项目中的文件更改?

c# - Polly 断路器已处理和未处理的异常

c# - 如何在 asp.net 应用程序中从 jquery 设置 HttpPost 端点