public void Dispose() { Socket socket = Interlocked.Exchange<Socket>( ref m_Listener, null ); if ( socket != null ) { socket.Close(); } }