xrtHttpSseClientConfigInit

初始化无总超时、无空闲超时、自动重连和有界重连延迟;允许未对齐存储。

void xrtHttpSseClientConfigInit( xhttpsseclientconfig* pConfig );
参数说明
xhttpsseclientconfig* pConfig配置结构
返回:初始化无总超时、无空闲超时、自动重连和有界重连延迟;允许未对齐存储。

示例已编译验证

httpsseclientconfiginit obj;
xrtHttpSseClientConfigInit(&obj);

xrtHttpSseConnect

使用 GET URL 建立会话;配置与事件表在返回前完整快照并允许未对齐存储。

xhttpsseclient* xrtHttpSseConnect( xhttpclient* pHttp, xstrview Url, const xhttpsseclientconfig* pConfig, const xhttpsseclientevents* pEvents );
参数说明
xhttpclient* pHttpHtt 参数
xstrview UrlURL 文本
const xhttpsseclientconfig* pConfig配置结构
const xhttpsseclientevents* pEvents事件回调表
返回:使用 GET URL 建立会话;配置与事件表在返回前完整快照并允许未对齐存储。

示例已编译验证

/* 使用 GET URL 建立会话;配置与事件表在返回前完整快照并允许未对齐存储。 */
result = xrtHttpSseConnect(pHttp, Url, pConfig, pEvents);

xrtHttpSseConnectRequest

克隆 GET 请求;配置与事件表在返回前完整快照并允许未对齐存储。

xhttpsseclient* xrtHttpSseConnectRequest( xhttpclient* pHttp, const xhttprequest* pRequest, const xhttpsseclientconfig* pConfig, const xhttpsseclientevents* pEvents );
参数说明
xhttpclient* pHttpHtt 参数
const xhttprequest* pRequest请求对象
const xhttpsseclientconfig* pConfig配置结构
const xhttpsseclientevents* pEvents事件回调表
返回:克隆 GET 请求;配置与事件表在返回前完整快照并允许未对齐存储。

示例已编译验证

/* 克隆 GET 请求;配置与事件表在返回前完整快照并允许未对齐存储。 */
result = xrtHttpSseConnectRequest(pHttp, pRequest, pConfig, pEvents);

xrtHttpSseClientRef

增加会话引用并返回原指针。

xhttpsseclient* xrtHttpSseClientRef( xhttpsseclient* pClient );
参数说明
xhttpsseclient* pClient客户端对象
返回:增加会话引用并返回原指针。

示例已编译验证

/* 增加会话引用并返回原指针。 */
result = xrtHttpSseClientRef(pClient);

xrtHttpSseClientDestroy

释放会话引用;空指针视为空操作,不隐式关闭仍活动的订阅。

void xrtHttpSseClientDestroy( xhttpsseclient* pClient );
参数说明
xhttpsseclient* pClient客户端对象
返回:释放会话引用;空指针视为空操作,不隐式关闭仍活动的订阅。

示例已编译验证

xrtHttpSseClientDestroy(pClient);

xrtHttpSseClientClose

从任意线程永久关闭当前 HTTP Call 或重连 Timer。

bool xrtHttpSseClientClose( xhttpsseclient* pClient );
参数说明
xhttpsseclient* pClient客户端对象
返回:从任意线程永久关闭当前 HTTP Call 或重连 Timer。

示例已编译验证

/* 从任意线程永久关闭当前 HTTP Call 或重连 Timer。 */
result = xrtHttpSseClientClose(pClient);

xrtHttpSseClientPause

在当前回调 Worker 上暂停项目交付和底层传输读取。

bool xrtHttpSseClientPause( xhttpsseclient* pClient );
参数说明
xhttpsseclient* pClient客户端对象
返回:在当前回调 Worker 上暂停项目交付和底层传输读取。

示例已编译验证

/* 在当前回调 Worker 上暂停项目交付和底层传输读取。 */
result = xrtHttpSseClientPause(pClient);

xrtHttpSseClientResume

从任意线程恢复 Parser 尾段,再开放底层传输读取。

bool xrtHttpSseClientResume( xhttpsseclient* pClient );
参数说明
xhttpsseclient* pClient客户端对象
返回:从任意线程恢复 Parser 尾段,再开放底层传输读取。

示例已编译验证

/* 从任意线程恢复 Parser 尾段,再开放底层传输读取。 */
result = xrtHttpSseClientResume(pClient);

xrtHttpSseClientState

返回当前 EventSource 三态的并发快照。

xhttpsseclientstate xrtHttpSseClientState( const xhttpsseclient* pClient );
参数说明
const xhttpsseclient* pClient客户端对象
返回:返回当前 EventSource 三态的并发快照。

示例已编译验证

/* 返回当前 EventSource 三态的并发快照。 */
result = xrtHttpSseClientState(pClient);

xrtHttpSseClientPaused

返回当前暂停门快照。

bool xrtHttpSseClientPaused( const xhttpsseclient* pClient );
参数说明
const xhttpsseclient* pClient客户端对象
返回:返回当前暂停门快照。

示例已编译验证

/* 返回当前暂停门快照。 */
result = xrtHttpSseClientPaused(pClient);

xrtHttpSseClientInfo

原子复制状态、状态码、重连时间和累计项目数量;输出允许未对齐存储。

bool xrtHttpSseClientInfo( const xhttpsseclient* pClient, xhttpsseclientinfo* pInfo );
参数说明
const xhttpsseclient* pClient客户端对象
xhttpsseclientinfo* pInfo上下文信息
返回:原子复制状态、状态码、重连时间和累计项目数量;输出允许未对齐存储。

示例已编译验证

/* 原子复制状态、状态码、重连时间和累计项目数量;输出允许未对齐存储。 */
result = xrtHttpSseClientInfo(pClient, pInfo);

xrtHttpSseClientError

唯一 Close 已发布后返回稳定错误;正常主动或 204 停止可以为空。

const xerror* xrtHttpSseClientError( const xhttpsseclient* pClient );
参数说明
const xhttpsseclient* pClient客户端对象
返回:唯一 Close 已发布后返回稳定错误;正常主动或 204 停止可以为空。

示例已编译验证

/* 唯一 Close 已发布后返回稳定错误;正常主动或 204 停止可以为空。 */
result = xrtHttpSseClientError(pClient);