예제 #1
0
        public void OnConnectionDisconnected()
        {
            if (Logging.IsEnabled)
            {
                Logging.Enter(this, $"{nameof(OnConnectionDisconnected)}");
            }
            if (SetNotUsable() == 0)
            {
                _amqpAuthenticationRefresher?.StopLoop();
                OnUnitDisconnected?.Invoke(false, EventArgs.Empty);
            }

            if (Logging.IsEnabled)
            {
                Logging.Exit(this, $"{nameof(OnConnectionDisconnected)}");
            }
        }
 private void OnConnectionClosed(object o, EventArgs args)
 {
     if (Logging.IsEnabled)
     {
         Logging.Enter(this, o, $"{nameof(OnConnectionClosed)}");
     }
     if (_amqpIoTConnection != null && ReferenceEquals(_amqpIoTConnection, 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)}");
     }
 }