public void Dispose() { if (m_attachedPoller != null) { DetachFromPoller(); } else if (!m_isStoppedEvent.WaitOne(0)) { Stop(); } if (m_isOwner) { MonitoringSocket.Dispose(); } }
/// <summary> /// Release and dispose of any contained resources. /// </summary> /// <param name="disposing">true if releasing managed resources</param> protected virtual void Dispose(bool disposing) { if (!disposing) { return; } if (m_attachedPoller != null) { DetachFromPoller(); } else if (!m_isStoppedEvent.WaitOne(0)) { Stop(); } m_isStoppedEvent.Close(); if (m_isOwner) { MonitoringSocket.Dispose(); } }