本文介绍了如何处理杀手信号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
.Net核心控制台应用程序,如何处理终止信号?
无
.Net Core console application,How to handle the kill signal?
无
推荐答案
[quote]
公开了SIGTERM的托管API.AssemblyLoadContext.Unloading 事件,当事件引发.我之所以知道这一点,仅是因为我已经在VSTS代理代码库中看到了它(请参阅此,第44行).
您可以看到coreclr如何将SIGTERM映射到关闭这里,第170行.
The managed API for SIGTERM is exposed by the AssemblyLoadContext.Unloading event, which is raised when the AppDomain.ProcessExit event is raised. I know this only because I’ve seen it used in the VSTS agent codebase (seethis, line 44).
You can see how coreclr maps SIGTERM to shutting down here, line 170.
[/quote]
这篇关于如何处理杀手信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!