/// <summary> /// 关闭服务 /// </summary> public void Stop() { if (_server != null) { _server.StopServer(); } }
private void btnStop_Click(object sender, EventArgs e) { if (sm != null) { try { sm.StopServer(); Thread.Sleep(100); _cache.StopUpdate(); _cache = null; Listening(false); } catch { } Thread.Sleep(1000); } }