using CoreAgent.WebSocketTransport.Models;
namespace CoreAgent.WebSocketTransport.Interfaces;
///
/// WebSocket 传输接口
/// 单一职责:连接管理
///
public interface IWebSocketTransport : IDisposable
{
///
/// 获取连接状态
///
bool IsConnected { get; }
///
/// 获取最后心跳时间
///
DateTime? LastHeartbeat { get; }
///
/// 异步连接 WebSocket 服务器
///
/// 取消令牌
Task ConnectAsync(CancellationToken cancellationToken = default);
///
/// 异步关闭连接
///
/// 取消令牌
Task CloseAsync(CancellationToken cancellationToken = default);
}