private void Shutdown() { if (Logging.IsEnabled) { Logging.Enter(this, AmqpConnection, $"{nameof(Shutdown)}"); } AmqpAuthenticationRefresher?.StopLoop(); AmqpConnection?.Abort(); OnConnectionDisconnected?.Invoke(this, EventArgs.Empty); if (Logging.IsEnabled) { Logging.Exit(this, AmqpConnection, $"{nameof(Shutdown)}"); } }
private void OnConnectionClosed(object o, EventArgs args) { if (Logging.IsEnabled) { Logging.Enter(this, o, $"{nameof(OnConnectionClosed)}"); } if (AmqpConnection != null && ReferenceEquals(AmqpConnection, o)) { AmqpAuthenticationRefresher?.StopLoop(); foreach (AmqpUnit unit in AmqpUnits.Values) { unit.OnConnectionDisconnected(); } AmqpUnits.Clear(); OnConnectionDisconnected?.Invoke(this, EventArgs.Empty); } if (Logging.IsEnabled) { Logging.Exit(this, o, $"{nameof(OnConnectionClosed)}"); } }
private void Dispose(bool disposing) { if (_disposed) { return; } if (Logging.IsEnabled) { Logging.Info(this, disposing, $"{nameof(Dispose)}"); } if (disposing) { AmqpConnection?.Abort(); Lock?.Dispose(); Connector?.Dispose(); AmqpUnits?.Clear(); AmqpAuthenticationRefresher?.Dispose(); OnConnectionDisconnected?.Invoke(this, EventArgs.Empty); } _disposed = true; }