示例#1
0
        /// <summary>
        ///  Shutdown this cluster instance. This closes all connections from all the
        ///  sessions of this <code>* Cluster</code> instance and reclaim all resources
        ///  used by it. <p> This method has no effect if the cluster was already shutdown.</p>
        /// </summary>
        public void Shutdown(int timeoutMs = Timeout.Infinite)
        {
            List <Session> conccpy;

            lock (_connectedSessions)
            {
                conccpy            = new List <Session>(_connectedSessions);
                _connectedSessions = new List <Session>();
            }

            foreach (var ses in conccpy)
            {
                ses.WaitForAllPendingActions(timeoutMs);
                ses.InternalDispose();
            }
            _metadata.Dispose();

            _logger.Info("Cluster [" + _metadata.ClusterName + "] has been shut down.");
        }