T
tshad
I have a Windows Service that I need to put to sleep for about 10-20
minutes.
The problem is that if you try to shut it down during this time, it will
tell you that the service didn't respond in time and end up in a "Stopping"
state and there is nothing you can do until you reboot the system.
What I did to solve the problem was just set a flag in my Shutdown method
and set up a loop in my program to go to sleep for 1 minute at a time, wake
up and check the flag then go to sleep for another minute until the maximum
number of minutes have elapsed.
What I don't know is what is the duration of time that a service has to
shutdown before it gets that message, or is there a setting somewhere where
you can set it?
Thanks,
Tom
minutes.
The problem is that if you try to shut it down during this time, it will
tell you that the service didn't respond in time and end up in a "Stopping"
state and there is nothing you can do until you reboot the system.
What I did to solve the problem was just set a flag in my Shutdown method
and set up a loop in my program to go to sleep for 1 minute at a time, wake
up and check the flag then go to sleep for another minute until the maximum
number of minutes have elapsed.
What I don't know is what is the duration of time that a service has to
shutdown before it gets that message, or is there a setting somewhere where
you can set it?
Thanks,
Tom