public void Reset(bool cleanup) { Utils.SafeExecute(() => { if (logger != null) { logger.Info("OutsideRuntimeClient.Reset(): client Id " + clientId); } }); Utils.SafeExecute(() => { if (clientProviderRuntime != null) { clientProviderRuntime.Reset(cleanup).WaitWithThrow(resetTimeout); } }, logger, "Client.clientProviderRuntime.Reset"); Utils.SafeExecute(() => { if (StatisticsCollector.CollectThreadTimeTrackingStats) { incomingMessagesThreadTimeTracking.OnStopExecution(); } }, logger, "Client.incomingMessagesThreadTimeTracking.OnStopExecution"); Utils.SafeExecute(() => { if (transport != null) { transport.PrepareToStop(); } }, logger, "Client.PrepareToStop-Transport"); listenForMessages = false; Utils.SafeExecute(() => { if (listeningCts != null) { listeningCts.Cancel(); } }, logger, "Client.Stop-ListeningCTS"); Utils.SafeExecute(() => { if (transport != null) { transport.Stop(); } }, logger, "Client.Stop-Transport"); Utils.SafeExecute(() => { if (ClientStatistics != null) { ClientStatistics.Stop(); } }, logger, "Client.Stop-ClientStatistics"); ConstructorReset(); }
public void Reset(bool cleanup) { Utils.SafeExecute(() => { if (logger != null) { logger.Info("OutsideRuntimeClient.Reset(): client Id " + clientId); } }, this.logger); Utils.SafeExecute(() => { if (typeMapRefreshTimer != null) { typeMapRefreshTimer.Dispose(); typeMapRefreshTimer = null; } }, logger, "Client.typeMapRefreshTimer.Dispose"); Utils.SafeExecute(() => { if (clientProviderRuntime != null) { clientProviderRuntime.Reset(cleanup).WaitWithThrow(ResetTimeout); } }, logger, "Client.clientProviderRuntime.Reset"); Utils.SafeExecute(() => { incomingMessagesThreadTimeTracking?.OnStopExecution(); }, logger, "Client.incomingMessagesThreadTimeTracking.OnStopExecution"); Utils.SafeExecute(() => { if (transport != null) { transport.Stop(); } }, logger, "Client.Stop-Transport"); Utils.SafeExecute(() => { if (ClientStatistics != null) { ClientStatistics.Stop(); } }, logger, "Client.Stop-ClientStatistics"); ConstructorReset(); }