/// <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(); }
/// <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); }
public KmodThreadCommand(KmodThread thread, K3pMsg msg, bool haveResultFlag) { m_thread = thread; Msg = msg; HaveResultFlag = haveResultFlag; }
/// <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(); }