W wl Well-Known Member Licensed User Longtime User Sep 13, 2013 #1 Hi, My app runs a service and in some cases it need to stop the service and restart it. I do this by (code in the service): Code: Copy StartServiceAt("Service_Main", nextConnectAt, True) StopService("") where nextConnectAt would tradionally be a second in the future. Could it be a problem that service has not yet fully stopped before it was scheduled to restart ? And also: would it be better to first stop and then schedule the restart ? Or: would it be better to reschedule the service in the Service_Destroy ? Thanks !
Hi, My app runs a service and in some cases it need to stop the service and restart it. I do this by (code in the service): Code: Copy StartServiceAt("Service_Main", nextConnectAt, True) StopService("") where nextConnectAt would tradionally be a second in the future. Could it be a problem that service has not yet fully stopped before it was scheduled to restart ? And also: would it be better to first stop and then schedule the restart ? Or: would it be better to reschedule the service in the Service_Destroy ? Thanks !
NJDude Expert Licensed User Longtime User Sep 13, 2013 #2 Every time you call StartServiceAt it cancels the previous schedule and restarts the service. Upvote 0
W wl Well-Known Member Licensed User Longtime User Sep 13, 2013 #3 Thanks NJDude, I was jut wondering if there could be an impact that I restart the exact same service from within this servcice before it was fully destroyed. Thanks Upvote 0
Thanks NJDude, I was jut wondering if there could be an impact that I restart the exact same service from within this servcice before it was fully destroyed. Thanks
thedesolatesoul Expert Licensed User Longtime User Sep 13, 2013 #4 You can do that. Thats how the service schedules itself. Upvote 0