You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
844 B
33 lines
844 B
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
|
|
}
|
|
}
|