Exemplo n.º 1
0
        /// <summary>
        /// Start all of the connection threads
        /// </summary>
        /// <param name="maxConns">Maxiumum number of worker connections to use</param>
        public void StartUp(int maxConns, bool doLogging)
        {
            _numConnections = maxConns;

            if (_config == null)
            {
                throw new Exception("No configuration object specified for connection pool");
            }

            if (_numConnections < 1)
            {
                throw new ArgumentOutOfRangeException("maxConns", "Must specify at least one connection");
            }

            //IMAPMailboxManager.InitializeMailbox();

            for (int i = 0; i < _numConnections; i++)
            {
                IMAPConnectionWorker worker = new IMAPConnectionWorker(_client, i);
                _loggers.Add(worker.Logger);
                worker.Logger.MessageLogged += Logger_MessageLogged;
                _workers.Add(worker);
                worker.Start(doLogging);
            }
        }
        /// <summary>
        /// Start all of the connection threads
        /// </summary>        
        /// <param name="maxConns">Maxiumum number of worker connections to use</param>
        public void StartUp(int maxConns)
        {
            _numConnections = maxConns;

            if (_config == null)
                throw new Exception("No configuration object specified for connection pool");

            if(_numConnections < 1)
                throw new ArgumentOutOfRangeException("maxConns","Must specify at least one connection");

            //IMAPMailboxManager.InitializeMailbox();

            for (int i = 0; i < _numConnections; i++)
            {
                IMAPConnectionWorker worker = new IMAPConnectionWorker(_client, i);
                _loggers.Add(worker.Logger);
                worker.Logger.MessageLogged += Logger_MessageLogged;
                _workers.Add(worker);
                worker.Start();
            }
        }