xrtSshChannelIoConfigInit
写入 2 MiB 收发硬上限。
| 参数 | 说明 |
|---|---|
| xsshchannelioconfig* pConfig | 配置结构 |
示例已编译验证
sshchannelioconfiginit obj; xrtSshChannelIoConfigInit(&obj);
xrtSshChannelIoInit
XRT_API bool xrtSshChannelIoInit( xsshchannelio* pIo, xnetbufpool* pPool, xsshchannelcore* pChannel, const xsshchannelioconfig* pConfig );
示例已编译验证
sshchannelioinit obj; xrtSshChannelIoInit(&obj);
xrtSshChannelIoClear
释放全部动态块;未读取数据按应用丢弃处理并转入 channel 待返还额度。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
示例已编译验证
/* 释放全部动态块;未读取数据按应用丢弃处理并转入 channel 待返还额度。 */ result = xrtSshChannelIoClear(pIo);
xrtSshChannelIoReadable
返回指定接收流当前已经可靠提交的可读字节数。
| 参数 | 说明 |
|---|---|
| const xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
示例已编译验证
/* 返回指定接收流当前已经可靠提交的可读字节数。 */ result = xrtSshChannelIoReadable(pIo, Stream);
xrtSshChannelIoReadBuffer
返回指定接收流的借用只读缓冲;对象失效或流类型错误时返回空。
| 参数 | 说明 |
|---|---|
| const xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
示例已编译验证
/* 返回指定接收流的借用只读缓冲;对象失效或流类型错误时返回空。 */ result = xrtSshChannelIoReadBuffer(pIo, Stream);
xrtSshChannelIoRead
复制并消费最多 Capacity 字节,同时把实际消费量转入接收窗口待返还额度。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pRead | Read 参数 |
示例已编译验证
/* 复制并消费最多 Capacity 字节,同时把实际消费量转入接收窗口待返还额度。 */ result = xrtSshChannelIoRead(pIo, Stream, pOutput, iCapacity, pRead);
xrtSshChannelIoConsume
零复制消费指定接收流的前缀,并更新 channel 接收窗口计数。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
| size_t iSize | 字节数 |
示例已编译验证
/* 零复制消费指定接收流的前缀,并更新 channel 接收窗口计数。 */ result = xrtSshChannelIoConsume(pIo, Stream, iSize);
xrtSshChannelIoQueued
返回指定发送流当前排队字节数。
| 参数 | 说明 |
|---|---|
| const xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
示例已编译验证
/* 返回指定发送流当前排队字节数。 */ result = xrtSshChannelIoQueued(pIo, Stream);
xrtSshChannelIoWritable
返回两条发送流共享硬上限中尚可受理的字节数。
| 参数 | 说明 |
|---|---|
| const xsshchannelio* pIo | IO |
示例已编译验证
/* 返回两条发送流共享硬上限中尚可受理的字节数。 */ result = xrtSshChannelIoWritable(pIo);
xrtSshChannelIoSendLimit
返回指定流下一条消息可发送的连续队首字节数,零表示无数据或远端窗口阻塞。
| 参数 | 说明 |
|---|---|
| const xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
示例已编译验证
/* 返回指定流下一条消息可发送的连续队首字节数,零表示无数据或远端窗口阻塞。 */ result = xrtSshChannelIoSendLimit(pIo, Stream);
xrtSshChannelIoWrite
在共享发送预算内追加一份数据副本。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
| const void* pData | 用户数据 |
| size_t iSize | 字节数 |
示例已编译验证
/* 在共享发送预算内追加一份数据副本。 */ result = xrtSshChannelIoWrite(pIo, Stream, pData, iSize);
xrtSshChannelIoWriteBorrow
追加借用数据;调用方保证其存活到消费或清理。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
| const void* pData | 用户数据 |
| size_t iSize | 字节数 |
示例已编译验证
/* 追加借用数据;调用方保证其存活到消费或清理。 */ result = xrtSshChannelIoWriteBorrow(pIo, Stream, pData, iSize);
xrtSshChannelIoWriteTake
接管由 xrtMalloc 家族分配的数据;失败或零长度不转移所有权。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
| void* pData | 用户数据 |
| size_t iSize | 字节数 |
示例已编译验证
/* 接管由 xrtMalloc 家族分配的数据;失败或零长度不转移所有权。 */ result = xrtSshChannelIoWriteTake(pIo, Stream, pData, iSize);
xrtSshChannelIoWriteRef
接管带释放过程的外部数据;失败或零长度不转移所有权。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
| xsshchanneliostream Stream | 流 |
| const void* pData | 用户数据 |
| size_t iSize | 字节数 |
| xnetreleaseproc pRelease | 释放回调 |
| ptr pContext | 上下文 |
示例已编译验证
/* 接管带释放过程的外部数据;失败或零长度不转移所有权。 */ result = xrtSshChannelIoWriteRef(pIo, Stream, pData, iSize, pRelease, pContext);
xrtSshChannelIoWriteBuffer
把调用方缓冲链移动到指定发送流;超出共享预算时源缓冲保持不变。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
| 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 ); */ result = xrtSshChannelIoReceivePrepare();
xrtSshChannelIoReceiveCommit
外层已提交 channel 接收状态后,把预分配块无分配移动到可读缓冲。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
示例已编译验证
/* 外层已提交 channel 接收状态后,把预分配块无分配移动到可读缓冲。 */ result = xrtSshChannelIoReceiveCommit(pIo);
xrtSshChannelIoReceiveAbort
在 channel 状态尚未提交时放弃接收预分配。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
示例已编译验证
/* 在 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 ); */ result = xrtSshChannelIoSendPrepare();
xrtSshChannelIoSendCommit
外层已提交 channel 发送状态后消费本次发送队首。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
示例已编译验证
/* 外层已提交 channel 发送状态后消费本次发送队首。 */ result = xrtSshChannelIoSendCommit(pIo);
xrtSshChannelIoSendAbort
在 channel 状态尚未提交时放弃发送事务,排队数据保持不变。
| 参数 | 说明 |
|---|---|
| xsshchannelio* pIo | IO |
示例已编译验证
/* 在 channel 状态尚未提交时放弃发送事务,排队数据保持不变。 */ result = xrtSshChannelIoSendAbort(pIo);