//! \brief timer
        private void PipelineTimeoutTimer(object sender, ElapsedEventArgs e)
        {
            if (m_wPipelineTimeoutCounter > 0)
            {
                m_wPipelineTimeoutCounter--;
                if (0 == m_wPipelineTimeoutCounter)
                {
                    //! service no response for quite a long time
                    m_TimeOutTimer.Stop();

                    try
                    {
                        //! time out
                        m_PipelineCoreThread.Abort();
                    }
                    catch (Exception) { }

                    //! drop service
                    lock (((ICollection)m_ServicesQueue).SyncRoot)
                    {
                        if (m_ServicesQueue.Count > 0)
                        {
                            PipelineCoreService ServiceItem = m_ServicesQueue.Dequeue();
                            if (null != ServiceItem)
                            {
                                //! raising event
                                ServiceItem.OnServiceCancelled();
                            }
                        }
                    }

                    try
                    {
                        m_PipelineCoreThread.Join();
                    }
                    catch (Exception) { }
                    finally
                    {
                        m_PipelineCoreThread = null;
                    }
                    if (m_RequestStop)
                    {
                        m_RequestStop = false;

                        //! raising event
                        OnPipelineCoreStateReport(PIPELINE_STATE.PIPELINE_STOPPED);
                    }
                    else
                    {
                        //! restart pipeline
                        PipelineOpen = true;
                    }
                }
            }
        }
        //! \brief pipeline background task
        private void PipelLineCoreBackgroundTask()
        {
            if (null == m_PipelineCoreThread)
            {
                return;
            }
            Boolean tWaitService = false;

            //LogWriter.Write("V");
            do
            {
                PipelineCoreService ServiceItem = null;

                if (tWaitService)
                {
                    m_WaitService.WaitOne();
                    tWaitService = false;
                }

                //! get queue item
                lock (((ICollection)m_ServicesQueue).SyncRoot)
                {
                    if (0 == m_ServicesQueue.Count)
                    {
                        if (AutoStart)
                        {
                            break;
                        }
                        else
                        {
                            tWaitService = true;
                            //Thread.Sleep(20);
                            continue;
                        }
                    }

                    //! get a new service item
                    ServiceItem = m_ServicesQueue.Peek();
                    if (null == ServiceItem)
                    {
                        m_ServicesQueue.Dequeue();
                        continue;
                    }
                    if (!ServiceItem.Available)
                    {
                        m_ServicesQueue.Dequeue();
                        continue;
                    }

                    //! raising event
                    ServiceItem.OnLine();
                }


                if (ServiceItem.Timeout > 0)
                {
                    m_wPipelineTimeoutCounter = ServiceItem.Timeout;
                    m_TimeOutTimer.Start();

                    do
                    {
                        if (!ServiceItem.DoService())
                        {
                            try
                            {
                                m_TimeOutTimer.Stop();
                                m_wPipelineTimeoutCounter = ServiceItem.Timeout;

                                if (ServiceItem.Cancelled)
                                {
                                    //! raising event
                                    ServiceItem.OnServiceCancelled();
                                }
                                else
                                {
                                    //! raising event
                                    ServiceItem.OnServiceComplete();
                                }
                                break;
                            }
                            catch (Exception)
                            {
                                break;
                            }
                        }

                        //! after stop request flag set to true, you have only m_wPipelineTimeout * 100ms to die...
                        if ((!m_RequestStop) && (!ServiceItem.Cancelled))
                        {
                            m_wPipelineTimeoutCounter = ServiceItem.Timeout;
                        }

                        //Thread.Sleep(1);
                    }while (true);

                    lock (((ICollection)m_ServicesQueue).SyncRoot)
                    {
                        try
                        {
                            m_ServicesQueue.Dequeue();
                        }
                        catch (Exception) { }
                    }
                }
                else
                {
                    do
                    {
                        if (!ServiceItem.DoService())
                        {
                            //! raising event
                            if (ServiceItem.Cancelled)
                            {
                                //! raising event
                                ServiceItem.OnServiceCancelled();
                            }
                            else
                            {
                                //! raising event
                                ServiceItem.OnServiceComplete();
                            }
                            break;
                        }

                        if ((m_RequestStop) || (ServiceItem.Cancelled))
                        {
                            //! after stop request flag set to true, it's your last chance...
                            ServiceItem.DoService();

                            //! raising event
                            ServiceItem.OnServiceCancelled();
                            break;
                        }
                    }while (true);

                    lock (((ICollection)m_ServicesQueue).SyncRoot)
                    {
                        if (m_ServicesQueue.Count > 0)
                        {
                            m_ServicesQueue.Dequeue();
                        }
                    }
                }

                m_wPipelineTimeoutCounter = 0;

                if (m_RequestStop)
                {
                    m_RequestStop = false;
                    break;
                }
            }while (true);

            //! raising event
            OnPipelineCoreStateReport(PIPELINE_STATE.PIPELINE_STOPPED);

            m_PipelineCoreThread = null;
        }