Exemplo n.º 1
0
        public void Stop()
        {
            _threadPoolScheduler.Dispose();

            _workers.Clear();

            _unsubscribeAction();
        }
Exemplo n.º 2
0
        public void Clear()
        {
            IEndpoint[] endpoints = _endpoints.Values.ToArray();
            _endpoints.Clear();

            foreach (IEndpoint endpoint in endpoints)
            {
                try
                {
                    endpoint.Dispose();
                }
                catch (Exception ex)
                {
                    _log.Error("An exception was thrown while disposing of an endpoint: " + endpoint.Address, ex);
                }
            }

            _endpoints.Clear();
        }
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (disposing)
            {
                _connectionCache.Values.Each(x => x.Dispose());
                _connectionCache.Clear();

                _connectionCache.Dispose();
            }

            _disposed = true;
        }
Exemplo n.º 4
0
        protected virtual void Dispose(bool managed)
        {
            if (_disposed)
            {
                return;
            }

            if (managed)
            {
                _connCache.Values.Each(x => x.Dispose());
                _connCache.Clear();
                _connCache.Dispose();

                _addresses.Values.Each(x => x.Dispose());
                _addresses.Clear();
                _addresses.Dispose();
            }

            _disposed = true;
        }