Example #1
0
        /// <summary>
        /// Starts SMTP relay server.
        /// </summary>
        /// <exception cref="ObjectDisposedException">Is raised when this object is disposed and this method is accessed.</exception>
        public virtual void Start()
        {
            if(m_IsDisposed){
                throw new ObjectDisposedException(this.GetType().Name);
            }
            if(m_IsRunning){
                return;
            }
            m_IsRunning = true;

            m_pLocalEndPointIPv4 = new CircleCollection<IPBindInfo>();
            m_pLocalEndPointIPv6 = new CircleCollection<IPBindInfo>();
            m_pSessions          = new TCP_SessionCollection<Relay_Session>();
            m_pConnectionsPerIP  = new Dictionary<IPAddress,long>();

            Thread tr1 = new Thread(new ThreadStart(this.Run));
            tr1.Start();

            m_pTimerTimeout = new TimerEx(30000);
            m_pTimerTimeout.Elapsed += new System.Timers.ElapsedEventHandler(m_pTimerTimeout_Elapsed);
            m_pTimerTimeout.Start();
        }