开发者

Will Windows Service complete the current task when it is stopped?

开发者 https://www.devze.com 2023-03-24 01:31 出处:网络
If we stop a windo开发者_如何转开发ws service, when it is in middle of some process specified in System.Timers.Timer.Elapsed() event, would the service

If we stop a windo开发者_如何转开发ws service, when it is in middle of some process specified in System.Timers.Timer.Elapsed() event, would the service

a. stop the process abruptly or

b. complete the process and stop the service?


Depends on what the service is designed to do. When you send a stop message to a service, the service gets a chance to do whatever it needs to do. This shows up as a call to your overridden ServiceMain.OnStop() in .NET. Some service may handle finishing of processing quickly. Other services might just kill child processes.

0

精彩评论

暂无评论...
验证码 换一张
取 消