Exemplo n.º 1
0
 protected override void DoStart()
 {
     base.DoStart();
     if (m_FallbackSink != null)
     {
         m_FallbackSink.Start();
     }
 }
Exemplo n.º 2
0
        protected override void DoStart()
        {
            log(MessageType.Info, "Entering DoStart()", null);

            try
            {
                if (m_Sink == null)
                {
                    throw new WebException(StringConsts.MAILER_SINK_IS_NOT_SET_ERROR);
                }

                m_Trigger = new AutoResetEvent(false);

                m_Queues = new ConcurrentQueue <Message> [(int)MsgPriority.Slowest + 1];
                for (var i = 0; i < m_Queues.Length; i++)
                {
                    m_Queues[i] = new ConcurrentQueue <Message>();
                }

                m_Sink.Start();
                m_FallbackSink.Start();

                m_Thread              = new Thread(threadSpin);
                m_Thread.Name         = THREAD_NAME;
                m_Thread.IsBackground = false;

                m_Thread.Start();
            }
            catch (Exception error)
            {
                AbortStart();

                if (m_Thread != null)
                {
                    m_Thread.Join();
                    m_Thread = null;
                }

                log(MessageType.CatastrophicError, "DoStart() exception: " + error.Message, null);
                throw error;
            }

            log(MessageType.Info, "Exiting DoStart()", null);
        }