protected void ProcessStop() { m_terminating = true; // If there are no sockets being reaped finish immediately. if (m_sockets == 0) { SendDone(); m_poller.RemoveHandle(m_mailboxHandle); m_poller.Stop(); } }
/// <summary> /// To be called after processing commands or invoking any command /// handlers explicitly. If required, it will deallocate the socket. /// </summary> private void CheckDestroy() { // If the object was already marked as destroyed, finish the deallocation. if (m_destroyed) { // Remove the socket from the reaper's poller. m_poller.RemoveHandle(m_handle); // Remove the socket from the context. DestroySocket(this); // Notify the reaper about the fact. SendReaped(); // Deallocate. base.ProcessDestroy(); } }