示例#1
0
        /// <summary>
        /// Closes a channel, removing it from the message broker.
        /// </summary>
        /// <param name="name">The name of the channel to close.</param>
        public void CloseChannel(string name)
        {
            Ensure.NotDisposed(this);
            ThrowIfChannelDoesNotExist(name);

            IMessageChannel channel = _channels[name];

            channel.Dispose();

            _channels.Remove(name);
        }
示例#2
0
        void IDisposable.Dispose()
        {
            _inputChannel.NewOutMessage  -= InputChannelOnNewOutMessage;
            _outputChannel.NewOutMessage -= OutputChannelOnNewOutMessage;

            if (OwnInputChannel)
            {
                _inputChannel.Dispose();
            }

            if (OwnOutputChannel)
            {
                _outputChannel.Dispose();
            }

            _adapter.NewOutMessage -= AdapterOnNewOutMessage;
            //_adapter.Dispose();
        }
 public void Dispose()
 {
     _messageChannel?.Dispose();
     _readerThread?.Dispose();
 }