protected override void OnClosing() { // stop the server. if (m_stopServerOnClose && m_server != null) { m_server.Stop(); m_server = null; } base.OnClosing(); }