using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using CoreAgent.ProtocolClient.Enums; namespace CoreAgent.ProtocolClient.ProtocolWsClient { public partial class ProtocolWsClient { #region 状态与定时器管理 private void SetState(ClientState state) { if (_context.State != state) { _context.State = state; StateChanged?.Invoke(this, state); } } private void StopTimers() { _reconnectTimer?.Dispose(); _reconnectTimer = null; _statsManager.StopStatsTimer(); _statsManager.ResetStatistics(); _readyTimer?.Dispose(); _readyTimer = null; } #endregion } }