The SocketInitator has a start and stop method that imply that it can be started/stopped/restarted. However, you can only start the Initiator once as the fact that it has been started is tracked by whether or not it has been initialized.
AbstractSocketInitiator.initiateSessions initializes the sessions and starts the sessionTimers.
SocketInitializer.initialize controls the flag of whether the initiator is initialized or not. An initialized initializer implies it has been started.
SocketInitializer.stop stops the sessionTimer and does not reset the initialized flag (which it shouldn't)
There are two different states that need to be tracked of an initializer.
1. whether or not it has been initialized (already tracked)
2. whether or not it has been started (implied by being initialized and needs to have its own flag).
As it stands, the only way to restart a SocketInitializer is to create an new instance and start it.
|