windows service suspend and continue option
-
Hi!, where do I configure the option that my windows service can be suspended and continued and not only started and stopped ? (I meen that the options are shown and selectable in the service list menue). Is it a code option or a setup option ? Thanks Frank
-
Hi!, where do I configure the option that my windows service can be suspended and continued and not only started and stopped ? (I meen that the options are shown and selectable in the service list menue). Is it a code option or a setup option ? Thanks Frank
I haven't had a need to do that and I can't imagine needing it. Why do you want to do it?
-
I haven't had a need to do that and I can't imagine needing it. Why do you want to do it?
Hi, that's not the question. If you examine the service list you will find some services which have these options and some have not. In my case it make sense to suspend the service do something with the data and after this to continue the service. So, please where is the option to be set ? Thanks Frank
-
Hi!, where do I configure the option that my windows service can be suspended and continued and not only started and stopped ? (I meen that the options are shown and selectable in the service list menue). Is it a code option or a setup option ? Thanks Frank
-
I believe
ServiceBase
has a property calledCanPauseAndContinue
. Set it to true and then override theOnPause
andOnContinue
methods. -
I haven't had a need to do that and I can't imagine needing it. Why do you want to do it?
PIEBALDconsult wrote:
Why do you want to do it?
Possibly to allow existing processing to terminate cleanly, and prevent some new processing, while still running other background processing.
-
Hi, that's not the question. If you examine the service list you will find some services which have these options and some have not. In my case it make sense to suspend the service do something with the data and after this to continue the service. So, please where is the option to be set ? Thanks Frank
But why not just stop and start?
-
PIEBALDconsult wrote:
Why do you want to do it?
Possibly to allow existing processing to terminate cleanly, and prevent some new processing, while still running other background processing.
Electron Shepherd wrote:
allow existing processing to terminate cleanly
Stop should do that as well.
Electron Shepherd wrote:
while still running other background processing.
Then it's not paused, is it?
Electron Shepherd wrote:
other background processing
Possibly should be in its own Service.
-
Electron Shepherd wrote:
allow existing processing to terminate cleanly
Stop should do that as well.
Electron Shepherd wrote:
while still running other background processing.
Then it's not paused, is it?
Electron Shepherd wrote:
other background processing
Possibly should be in its own Service.
A good example would be a web server implementing Keep-Alive. You may need to prevent new inbound connections, possibly for load balancing or other resource allocation requirements, but preserve the internal state data. Dont forget that just because you've never needed to do it doesn't mean no-one ever needs to do it.
-
A good example would be a web server implementing Keep-Alive. You may need to prevent new inbound connections, possibly for load balancing or other resource allocation requirements, but preserve the internal state data. Dont forget that just because you've never needed to do it doesn't mean no-one ever needs to do it.
Electron Shepherd wrote:
A good example would be a web server implementing Keep-Alive. You may need to prevent new inbound connections, possibly for load balancing or other resource allocation requirements, but preserve the internal state data.
And you are suggesting that you would not do that when stopping as well?
Electron Shepherd wrote:
Dont forget that just because you've never needed to do it doesn't mean no-one ever needs to do it.
Don't forget that just because someone wants to do something it means that it is a good idea. Or even that it will solve their real problem.
-
Electron Shepherd wrote:
A good example would be a web server implementing Keep-Alive. You may need to prevent new inbound connections, possibly for load balancing or other resource allocation requirements, but preserve the internal state data.
And you are suggesting that you would not do that when stopping as well?
Electron Shepherd wrote:
Dont forget that just because you've never needed to do it doesn't mean no-one ever needs to do it.
Don't forget that just because someone wants to do something it means that it is a good idea. Or even that it will solve their real problem.
jschell wrote:
And you are suggesting that you would not do that when stopping as well?
Yes, becuase in my specific example, the internal state is related to a TCP connection, so maintaining and restoring the state across a stop / start event is meaninglesss.
jschell wrote:
Don't forget that just because someone wants to do something it means that it is a good idea.
True. My reply was directed at the person who said (very unhelpfully in my opinion) "I haven't had a need to do that and I can't imagine needing it."