示例#1
0
        private void CloseDataChannel()
        {
            try
            {
                _log.Information("Relay: {relay}. Closing the data channel", _relay);

                _uplinkPumps.DisposeAndClear();

                _downlinkPump.IgnoreException(x => x.Dispose());
                _downlinkPump = null;

                if (_dataChannel != null)
                {
                    _dataChannel.Dispose();
                    _dataChannel = null;
                }

                _canAcceptUntil = DateTime.MaxValue;

                OnDataChannelClosed?.Invoke(this);

                _log.Debug("Relay: {relay}. The data channel was closed", _relay);
            }
            catch
            {
                // intentional
            }
        }
示例#2
0
        public void Dispose()
        {
            try
            {
                _log.Information("Closing the data channel {relayTags}", _metrics);

                _uplinkPumps.DisposeAndClear();

                _downlinkPump.IgnoreException(x => x.Dispose());

                _log.Debug("The data channel was closed {relayTags}", _metrics);
            }
            catch
            {
                // intentional
            }
        }