public void StopServer() { try { if (_socketServer == null) { return; } //挂起所有会话 _socketServer.CloseAllSessions(); //关闭服务 _socketServer.Stop(); } catch (Exception ex) { throw ex; } }