xrtSshChannelIoConfigInit

写入 2 MiB 收发硬上限。

void xrtSshChannelIoConfigInit(xsshchannelioconfig* pConfig);
参数说明
xsshchannelioconfig* pConfig配置结构
返回:写入 2 MiB 收发硬上限。

示例已编译验证

sshchannelioconfiginit obj;
xrtSshChannelIoConfigInit(&obj);

xrtSshChannelIoInit

XRT_API bool xrtSshChannelIoInit( xsshchannelio* pIo, xnetbufpool* pPool, xsshchannelcore* pChannel, const xsshchannelioconfig* pConfig );

;
返回:XRT_API bool xrtSshChannelIoInit( xsshchannelio* pIo, xnetbufpool* pPool, xsshchannelcore* pChannel, const xsshchannelioconfig* pConfig );

示例已编译验证

sshchannelioinit obj;
xrtSshChannelIoInit(&obj);

xrtSshChannelIoClear

释放全部动态块;未读取数据按应用丢弃处理并转入 channel 待返还额度。

void xrtSshChannelIoClear(xsshchannelio* pIo);
参数说明
xsshchannelio* pIoIO
返回:释放全部动态块;未读取数据按应用丢弃处理并转入 channel 待返还额度。

示例已编译验证

/* 释放全部动态块;未读取数据按应用丢弃处理并转入 channel 待返还额度。 */
result = xrtSshChannelIoClear(pIo);

xrtSshChannelIoReadable

返回指定接收流当前已经可靠提交的可读字节数。

size_t xrtSshChannelIoReadable( const xsshchannelio* pIo, xsshchanneliostream Stream );
参数说明
const xsshchannelio* pIoIO
xsshchanneliostream Stream流
返回:返回指定接收流当前已经可靠提交的可读字节数。

示例已编译验证

/* 返回指定接收流当前已经可靠提交的可读字节数。 */
result = xrtSshChannelIoReadable(pIo, Stream);

xrtSshChannelIoReadBuffer

返回指定接收流的借用只读缓冲;对象失效或流类型错误时返回空。

const xnetbuf* xrtSshChannelIoReadBuffer( const xsshchannelio* pIo, xsshchanneliostream Stream );
参数说明
const xsshchannelio* pIoIO
xsshchanneliostream Stream流
返回:返回指定接收流的借用只读缓冲;对象失效或流类型错误时返回空。

示例已编译验证

/* 返回指定接收流的借用只读缓冲;对象失效或流类型错误时返回空。 */
result = xrtSshChannelIoReadBuffer(pIo, Stream);

xrtSshChannelIoRead

复制并消费最多 Capacity 字节,同时把实际消费量转入接收窗口待返还额度。

xsshcode xrtSshChannelIoRead( xsshchannelio* pIo, xsshchanneliostream Stream, void* pOutput, size_t iCapacity, size_t* pRead );
参数说明
xsshchannelio* pIoIO
xsshchanneliostream Stream流
void* pOutput出:输出缓冲
size_t iCapacity容量
size_t* pReadRead 参数
返回:复制并消费最多 Capacity 字节,同时把实际消费量转入接收窗口待返还额度。

示例已编译验证

/* 复制并消费最多 Capacity 字节,同时把实际消费量转入接收窗口待返还额度。 */
result = xrtSshChannelIoRead(pIo, Stream, pOutput, iCapacity, pRead);

xrtSshChannelIoConsume

零复制消费指定接收流的前缀,并更新 channel 接收窗口计数。

xsshcode xrtSshChannelIoConsume( xsshchannelio* pIo, xsshchanneliostream Stream, size_t iSize );
参数说明
xsshchannelio* pIoIO
xsshchanneliostream Stream流
size_t iSize字节数
返回:零复制消费指定接收流的前缀,并更新 channel 接收窗口计数。

示例已编译验证

/* 零复制消费指定接收流的前缀,并更新 channel 接收窗口计数。 */
result = xrtSshChannelIoConsume(pIo, Stream, iSize);

xrtSshChannelIoQueued

返回指定发送流当前排队字节数。

size_t xrtSshChannelIoQueued( const xsshchannelio* pIo, xsshchanneliostream Stream );
参数说明
const xsshchannelio* pIoIO
xsshchanneliostream Stream流
返回:返回指定发送流当前排队字节数。

示例已编译验证

/* 返回指定发送流当前排队字节数。 */
result = xrtSshChannelIoQueued(pIo, Stream);

xrtSshChannelIoWritable

返回两条发送流共享硬上限中尚可受理的字节数。

size_t xrtSshChannelIoWritable(const xsshchannelio* pIo);
参数说明
const xsshchannelio* pIoIO
返回:返回两条发送流共享硬上限中尚可受理的字节数。

示例已编译验证

/* 返回两条发送流共享硬上限中尚可受理的字节数。 */
result = xrtSshChannelIoWritable(pIo);

xrtSshChannelIoSendLimit

返回指定流下一条消息可发送的连续队首字节数,零表示无数据或远端窗口阻塞。

size_t xrtSshChannelIoSendLimit( const xsshchannelio* pIo, xsshchanneliostream Stream );
参数说明
const xsshchannelio* pIoIO
xsshchanneliostream Stream流
返回:返回指定流下一条消息可发送的连续队首字节数,零表示无数据或远端窗口阻塞。

示例已编译验证

/* 返回指定流下一条消息可发送的连续队首字节数,零表示无数据或远端窗口阻塞。 */
result = xrtSshChannelIoSendLimit(pIo, Stream);

xrtSshChannelIoWrite

在共享发送预算内追加一份数据副本。

xsshcode xrtSshChannelIoWrite( xsshchannelio* pIo, xsshchanneliostream Stream, const void* pData, size_t iSize );
参数说明
xsshchannelio* pIoIO
xsshchanneliostream Stream流
const void* pData用户数据
size_t iSize字节数
返回:在共享发送预算内追加一份数据副本。

示例已编译验证

/* 在共享发送预算内追加一份数据副本。 */
result = xrtSshChannelIoWrite(pIo, Stream, pData, iSize);

xrtSshChannelIoWriteBorrow

追加借用数据;调用方保证其存活到消费或清理。

xsshcode xrtSshChannelIoWriteBorrow( xsshchannelio* pIo, xsshchanneliostream Stream, const void* pData, size_t iSize );
参数说明
xsshchannelio* pIoIO
xsshchanneliostream Stream流
const void* pData用户数据
size_t iSize字节数
返回:追加借用数据;调用方保证其存活到消费或清理。

示例已编译验证

/* 追加借用数据;调用方保证其存活到消费或清理。 */
result = xrtSshChannelIoWriteBorrow(pIo, Stream, pData, iSize);

xrtSshChannelIoWriteTake

接管由 xrtMalloc 家族分配的数据;失败或零长度不转移所有权。

xsshcode xrtSshChannelIoWriteTake( xsshchannelio* pIo, xsshchanneliostream Stream, void* pData, size_t iSize );
参数说明
xsshchannelio* pIoIO
xsshchanneliostream Stream流
void* pData用户数据
size_t iSize字节数
返回:接管由 xrtMalloc 家族分配的数据;失败或零长度不转移所有权。

示例已编译验证

/* 接管由 xrtMalloc 家族分配的数据;失败或零长度不转移所有权。 */
result = xrtSshChannelIoWriteTake(pIo, Stream, pData, iSize);

xrtSshChannelIoWriteRef

接管带释放过程的外部数据;失败或零长度不转移所有权。

xsshcode xrtSshChannelIoWriteRef( xsshchannelio* pIo, xsshchanneliostream Stream, const void* pData, size_t iSize, xnetreleaseproc pRelease, ptr pContext );
参数说明
xsshchannelio* pIoIO
xsshchanneliostream Stream流
const void* pData用户数据
size_t iSize字节数
xnetreleaseproc pRelease释放回调
ptr pContext上下文
返回:接管带释放过程的外部数据;失败或零长度不转移所有权。

示例已编译验证

/* 接管带释放过程的外部数据;失败或零长度不转移所有权。 */
result = xrtSshChannelIoWriteRef(pIo, Stream, pData, iSize, pRelease, pContext);

xrtSshChannelIoWriteBuffer

把调用方缓冲链移动到指定发送流;超出共享预算时源缓冲保持不变。

xsshcode xrtSshChannelIoWriteBuffer( xsshchannelio* pIo, xsshchanneliostream Stream, xnetbuf* pBuffer );
参数说明
xsshchannelio* pIoIO
xsshchanneliostream Stream流
xnetbuf* pBuffer缓冲区
返回:把调用方缓冲链移动到指定发送流;超出共享预算时源缓冲保持不变。

示例已编译验证

/* 把调用方缓冲链移动到指定发送流;超出共享预算时源缓冲保持不变。 */
result = xrtSshChannelIoWriteBuffer(pIo, Stream, pBuffer);

xrtSshChannelIoReceivePrepare

XRT_API xsshcode xrtSshChannelIoReceivePrepare( xsshchannelio* pIo, xsshchanneliostream Stream, uint32 iRecipient, xbytesview Data );

;
返回:XRT_API xsshcode xrtSshChannelIoReceivePrepare( xsshchannelio* pIo, xsshchanneliostream Stream, uint32 iRecipient, xbytesview Data );

示例已编译验证

/* XRT_API xsshcode xrtSshChannelIoReceivePrepare( xsshchannelio* pIo, xsshchanneliostream Stream, uint32 iRecipient, xbytesview Data ); */
result = xrtSshChannelIoReceivePrepare();

xrtSshChannelIoReceiveCommit

外层已提交 channel 接收状态后,把预分配块无分配移动到可读缓冲。

xsshcode xrtSshChannelIoReceiveCommit(xsshchannelio* pIo);
参数说明
xsshchannelio* pIoIO
返回:外层已提交 channel 接收状态后,把预分配块无分配移动到可读缓冲。

示例已编译验证

/* 外层已提交 channel 接收状态后,把预分配块无分配移动到可读缓冲。 */
result = xrtSshChannelIoReceiveCommit(pIo);

xrtSshChannelIoReceiveAbort

在 channel 状态尚未提交时放弃接收预分配。

xsshcode xrtSshChannelIoReceiveAbort(xsshchannelio* pIo);
参数说明
xsshchannelio* pIoIO
返回:在 channel 状态尚未提交时放弃接收预分配。

示例已编译验证

/* 在 channel 状态尚未提交时放弃接收预分配。 */
result = xrtSshChannelIoReceiveAbort(pIo);

xrtSshChannelIoSendPrepare

XRT_API xsshcode xrtSshChannelIoSendPrepare( xsshchannelio* pIo, xsshchanneliostream Stream, xsshwriter* pWriter, xbytesview* pPayload );

;
返回:XRT_API xsshcode xrtSshChannelIoSendPrepare( xsshchannelio* pIo, xsshchanneliostream Stream, xsshwriter* pWriter, xbytesview* pPayload );

示例已编译验证

/* XRT_API xsshcode xrtSshChannelIoSendPrepare( xsshchannelio* pIo, xsshchanneliostream Stream, xsshwriter* pWriter, xbytesview* pPayload ); */
result = xrtSshChannelIoSendPrepare();

xrtSshChannelIoSendCommit

外层已提交 channel 发送状态后消费本次发送队首。

xsshcode xrtSshChannelIoSendCommit(xsshchannelio* pIo);
参数说明
xsshchannelio* pIoIO
返回:外层已提交 channel 发送状态后消费本次发送队首。

示例已编译验证

/* 外层已提交 channel 发送状态后消费本次发送队首。 */
result = xrtSshChannelIoSendCommit(pIo);

xrtSshChannelIoSendAbort

在 channel 状态尚未提交时放弃发送事务,排队数据保持不变。

xsshcode xrtSshChannelIoSendAbort(xsshchannelio* pIo);
参数说明
xsshchannelio* pIoIO
返回:在 channel 状态尚未提交时放弃发送事务,排队数据保持不变。

示例已编译验证

/* 在 channel 状态尚未提交时放弃发送事务,排队数据保持不变。 */
result = xrtSshChannelIoSendAbort(pIo);