Exemplo n.º 1
0
        /// <summary>
        /// Handle the completion of the KMOD thread.
        /// </summary>
        public void OnThreadCompletion()
        {
            // Get the reference to the exception, if any.
            Exception ex = m_curThread.Ex;

            // Clear the reference to the thread.
            m_curThread = null;

            // Handle the error if it was yet unhandled.
            if (ex != null || m_curTransaction != null)
            {
                if (ex == null)
                {
                    ex = new Exception("unexpected thread termination");
                }
                Killall(ex);
            }

            // Notify the listeners.
            if (OnThreadCollected != null)
            {
                OnThreadCollected(this, null);
            }

            // Process the next transactions.
            RequestRun();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Start the KMOD thread and send it the connect command.
 /// </summary>
 private void StartKmodThread()
 {
     Debug.Assert(m_curThread == null);
     Debug.Assert(m_curCommand == null);
     m_curThread = new KmodThread(this);
     m_curThread.Start();
     m_curCommand = new KmodThreadCommand(m_curThread, new K3p.k3p_connect(), true);
     m_curThread.PostToWorker(m_curCommand);
 }
Exemplo n.º 3
0
 public KmodThreadCommand(KmodThread thread, K3pMsg msg, bool haveResultFlag)
 {
     m_thread       = thread;
     Msg            = msg;
     HaveResultFlag = haveResultFlag;
 }