using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace LeanCloud.Realtime.Internal
{
///
/// LeanCloud WebSocket 客户端接口
///
public interface IWebSocketClient
{
///
/// 客户端 WebSocket 长连接是否打开
///
bool IsOpen { get; }
///
/// WebSocket 长连接关闭时触发的事件回调
///
event Action OnClosed;
///
/// 云端发送数据包给客户端,WebSocket 接受到时触发的事件回调
///
event Action OnMessage;
///
/// 客户端 WebSocket 长连接成功打开时,触发的事件回调
///
event Action OnOpened;
///
/// 主动关闭连接
///
void Close();
void Disconnect();
///
/// 打开连接
///
/// wss 地址
/// 子协议
void Open(string url, string protocol = null);
///
/// 发送数据包的接口
///
///
void Send(string message);
Task Connect(string url, string protocol = null);
}
}