void PushResultsLoop() { SEND_RESULT result; while (!m_Stop) { Thread.Sleep(10); result = m_SendResultQ.Dequeue(); if (result != null) { // look up the callback function to use in the hash table object cb = m_SendResultEvents[result.Mail_Key]; if (cb != null) { SEND_RESULT_EVENT sendEvent = (SEND_RESULT_EVENT)cb; // raise the event - notify the message originator of the result sendEvent(result); // remove the event handler from the hash table for this message m_SendResultEvents.Remove(result.Mail_Key); } } } }
/// <summary> /// generates exception if index is not in the hashtable /// </summary> /// <param name="index"></param> public void ReleaseValue(int handle) { handleHashTable.Remove(handle); }