Difference between Shutdown and Dispose
Posted: 26 May 2020, 09:30
In the GettingStarted example I see that you have an overridden Shutdown() method and an overridden Dispose() method.
They do the same thing i.e. they dispose of the alarmTimer.
While debugging I see that when Stop() is called on the ServerManager, it calls the Shutdown() methods of all the node managers (just one in this case) that have been added to it. And then it calls the Dispose() method, but looks like the job has been already done.
So what I don't get is the purpose of the Shutdown() method. I think that the idea is that it should release everything the node manager is using and is the only one that takes care of it. So maybe instead of duplicating the code, isn't the Shutdown() method supposed to call the Dispose() method from within itself?. Apparently not, because Dispose() is called in a later stage, but than why does Shutdown() even exists?
Thanks,
baldo
They do the same thing i.e. they dispose of the alarmTimer.
While debugging I see that when Stop() is called on the ServerManager, it calls the Shutdown() methods of all the node managers (just one in this case) that have been added to it. And then it calls the Dispose() method, but looks like the job has been already done.
So what I don't get is the purpose of the Shutdown() method. I think that the idea is that it should release everything the node manager is using and is the only one that takes care of it. So maybe instead of duplicating the code, isn't the Shutdown() method supposed to call the Dispose() method from within itself?. Apparently not, because Dispose() is called in a later stage, but than why does Shutdown() even exists?
Thanks,
baldo