示例#1
0
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                if (Logging.IsEnabled)
                {
                    Logging.Enter(this, disposing, $"{nameof(Dispose)}");
                }
                if (SetNotUsable() == 0)
                {
                    OnUnitDisconnected?.Invoke(false, EventArgs.Empty);
                }

                _amqpIoTSession?.Abort();
                if (Logging.IsEnabled)
                {
                    Logging.Exit(this, disposing, $"{nameof(Dispose)}");
                }
            }

            _disposed = true;
        }