xrtSshChannelCoreOpenInit

初始化等待 peer confirmation 的本端 channel open。

bool xrtSshChannelCoreOpenInit( xsshchannelcore* pChannel, uint32 iLocal, uint32 iReceiveWindow, uint32 iReceiveMaxPacket, uint32 iAdjustThreshold );
参数说明
xsshchannelcore* pChannel通道对象
uint32 iLocalLocal 参数
uint32 iReceiveWindowReceveWndow 参数
uint32 iReceiveMaxPacketReceveMaxPacket 参数
uint32 iAdjustThresholdAdjustThreshold 参数
返回:初始化等待 peer confirmation 的本端 channel open。

示例已编译验证

sshchannelcoreopeninit obj;
xrtSshChannelCoreOpenInit(&obj, pChannel, iLocal, iReceiveWindow, iReceiveMaxPacket, iAdjustThreshold);

xrtSshChannelCoreAcceptInit

从已解析 peer open 初始化等待本端 confirmation 的 channel。

bool xrtSshChannelCoreAcceptInit( xsshchannelcore* pChannel, uint32 iLocal, const xsshchannelopen* pOpen, uint32 iReceiveWindow, uint32 iReceiveMaxPacket, uint32 iAdjustThreshold );
参数说明
xsshchannelcore* pChannel通道对象
uint32 iLocalLocal 参数
const xsshchannelopen* pOpenOen 参数
uint32 iReceiveWindowReceveWndow 参数
uint32 iReceiveMaxPacketReceveMaxPacket 参数
uint32 iAdjustThresholdAdjustThreshold 参数
返回:从已解析 peer open 初始化等待本端 confirmation 的 channel。

示例已编译验证

sshchannelcoreacceptinit obj;
xrtSshChannelCoreAcceptInit(&obj, pChannel, iLocal, pOpen, iReceiveWindow, iReceiveMaxPacket, iAdjustThreshold);

xrtSshChannelCoreClear

清除 channel core;不会清理调用方数据或 request reply 队列。

void xrtSshChannelCoreClear(xsshchannelcore* pChannel);
参数说明
xsshchannelcore* pChannel通道对象
返回:清除 channel core;不会清理调用方数据或 request reply 队列。

示例已编译验证

/* 清除 channel core;不会清理调用方数据或 request reply 队列。 */
result = xrtSshChannelCoreClear(pChannel);

xrtSshChannelCorePhase

返回公开 channel 阶段;无效对象返回 FAILED。

xsshchannelcorephase xrtSshChannelCorePhase( const xsshchannelcore* pChannel );
参数说明
const xsshchannelcore* pChannel通道对象
返回:返回公开 channel 阶段;无效对象返回 FAILED。

示例已编译验证

/* 返回公开 channel 阶段;无效对象返回 FAILED。 */
result = xrtSshChannelCorePhase(pChannel);

xrtSshChannelCoreIds

返回本端 channel id;远端 id 仅在 accepting/open/closed 阶段可用。

bool xrtSshChannelCoreIds( const xsshchannelcore* pChannel, uint32* pLocal, uint32* pRemote );
参数说明
const xsshchannelcore* pChannel通道对象
uint32* pLocal本地地址
uint32* pRemote远端地址
返回:返回本端 channel id;远端 id 仅在 accepting/open/closed 阶段可用。

示例已编译验证

/* 返回本端 channel id;远端 id 仅在 accepting/open/closed 阶段可用。 */
result = xrtSshChannelCoreIds(pChannel, pLocal, pRemote);

xrtSshChannelCoreConfirmationCommit

提交 peer 对本端 open 的 confirmation,并原子开放数据面。

xsshcode xrtSshChannelCoreConfirmationCommit( xsshchannelcore* pChannel, const xsshchannelconfirmation* pConfirmation );
参数说明
xsshchannelcore* pChannel通道对象
const xsshchannelconfirmation* pConfirmationConfrmaton 参数
返回:提交 peer 对本端 open 的 confirmation,并原子开放数据面。

示例已编译验证

/* 提交 peer 对本端 open 的 confirmation,并原子开放数据面。 */
result = xrtSshChannelCoreConfirmationCommit(pChannel, pConfirmation);

xrtSshChannelCoreFailureCommit

提交 peer 对本端 open 的 failure,并保留失败 reason。

xsshcode xrtSshChannelCoreFailureCommit( xsshchannelcore* pChannel, const xsshchannelopenfailure* pFailure );
参数说明
xsshchannelcore* pChannel通道对象
const xsshchannelopenfailure* pFailureFalure 参数
返回:提交 peer 对本端 open 的 failure,并保留失败 reason。

示例已编译验证

/* 提交 peer 对本端 open 的 failure,并保留失败 reason。 */
result = xrtSshChannelCoreFailureCommit(pChannel, pFailure);

xrtSshChannelCoreAcceptCommit

本端 confirmation 已可靠排队后提交 peer open。

xsshcode xrtSshChannelCoreAcceptCommit(xsshchannelcore* pChannel);
参数说明
xsshchannelcore* pChannel通道对象
返回:本端 confirmation 已可靠排队后提交 peer open。

示例已编译验证

/* 本端 confirmation 已可靠排队后提交 peer open。 */
result = xrtSshChannelCoreAcceptCommit(pChannel);

xrtSshChannelCoreRejectCommit

本端 failure 已可靠排队后提交拒绝结果。

xsshcode xrtSshChannelCoreRejectCommit( xsshchannelcore* pChannel, uint32 iReason );
参数说明
xsshchannelcore* pChannel通道对象
uint32 iReason原因文本
返回:本端 failure 已可靠排队后提交拒绝结果。

示例已编译验证

/* 本端 failure 已可靠排队后提交拒绝结果。 */
result = xrtSshChannelCoreRejectCommit(pChannel, iReason);

xrtSshChannelCoreOpen

判断数据面是否已打开或双向 close 是否已经完成。

bool xrtSshChannelCoreOpen(const xsshchannelcore* pChannel);
参数说明
const xsshchannelcore* pChannel通道对象
返回:判断数据面是否已打开或双向 close 是否已经完成。

示例已编译验证

/* 判断数据面是否已打开或双向 close 是否已经完成。 */
result = xrtSshChannelCoreOpen(pChannel);

xrtSshChannelCoreClosed

XRT_API bool xrtSshChannelCoreClosed(const xsshchannelcore* pChannel);

;
返回:XRT_API bool xrtSshChannelCoreClosed(const xsshchannelcore* pChannel);

示例已编译验证

/* XRT_API bool xrtSshChannelCoreClosed(const xsshchannelcore* pChannel); */
result = xrtSshChannelCoreClosed();

xrtSshChannelCoreSendLimit

返回下一条 data/extended-data payload 可发送的最大字节数。

uint32 xrtSshChannelCoreSendLimit( const xsshchannelcore* pChannel );
参数说明
const xsshchannelcore* pChannel通道对象
返回:返回下一条 data/extended-data payload 可发送的最大字节数。

示例已编译验证

/* 返回下一条 data/extended-data payload 可发送的最大字节数。 */
result = xrtSshChannelCoreSendLimit(pChannel);

xrtSshChannelCoreDataSendCommit

data 可靠排队后扣减远端窗口;EOF/CLOSE 后拒绝新数据。

xsshcode xrtSshChannelCoreDataSendCommit( xsshchannelcore* pChannel, uint32 iBytes );
参数说明
xsshchannelcore* pChannel通道对象
uint32 iBytes字节数
返回:data 可靠排队后扣减远端窗口;EOF/CLOSE 后拒绝新数据。

示例已编译验证

/* data 可靠排队后扣减远端窗口;EOF/CLOSE 后拒绝新数据。 */
result = xrtSshChannelCoreDataSendCommit(pChannel, iBytes);

xrtSshChannelCoreDataReceiveCommit

提交已验证的 peer data,并校验本端 recipient、窗口和生命周期。

xsshcode xrtSshChannelCoreDataReceiveCommit( xsshchannelcore* pChannel, uint32 iRecipient, uint32 iBytes );
参数说明
xsshchannelcore* pChannel通道对象
uint32 iRecipient收件人通道号
uint32 iBytes字节数
返回:提交已验证的 peer data,并校验本端 recipient、窗口和生命周期。

示例已编译验证

/* 提交已验证的 peer data,并校验本端 recipient、窗口和生命周期。 */
result = xrtSshChannelCoreDataReceiveCommit(pChannel, iRecipient, iBytes);

xrtSshChannelCoreDataConsume

应用消费已接收数据;close 后仍可释放此前缓冲的数据。

xsshcode xrtSshChannelCoreDataConsume( xsshchannelcore* pChannel, uint32 iBytes );
参数说明
xsshchannelcore* pChannel通道对象
uint32 iBytes字节数
返回:应用消费已接收数据;close 后仍可释放此前缓冲的数据。

示例已编译验证

/* 应用消费已接收数据;close 后仍可释放此前缓冲的数据。 */
result = xrtSshChannelCoreDataConsume(pChannel, iBytes);

xrtSshChannelCoreAdjustReady

判断是否应发送 WINDOW_ADJUST,并返回当前可安全返还额度。

bool xrtSshChannelCoreAdjustReady( const xsshchannelcore* pChannel );
参数说明
const xsshchannelcore* pChannel通道对象
返回:判断是否应发送 WINDOW_ADJUST,并返回当前可安全返还额度。

示例已编译验证

/* 判断是否应发送 WINDOW_ADJUST,并返回当前可安全返还额度。 */
result = xrtSshChannelCoreAdjustReady(pChannel);

xrtSshChannelCoreAdjustLimit

XRT_API uint32 xrtSshChannelCoreAdjustLimit( const xsshchannelcore* pChannel );

;
返回:XRT_API uint32 xrtSshChannelCoreAdjustLimit( const xsshchannelcore* pChannel );

示例已编译验证

/* XRT_API uint32 xrtSshChannelCoreAdjustLimit( const xsshchannelcore* pChannel ); */
result = xrtSshChannelCoreAdjustLimit();

xrtSshChannelCoreAdjustSendCommit

WINDOW_ADJUST 可靠排队后提交本端返还额度。

xsshcode xrtSshChannelCoreAdjustSendCommit( xsshchannelcore* pChannel, uint32 iBytes );
参数说明
xsshchannelcore* pChannel通道对象
uint32 iBytes字节数
返回:WINDOW_ADJUST 可靠排队后提交本端返还额度。

示例已编译验证

/* WINDOW_ADJUST 可靠排队后提交本端返还额度。 */
result = xrtSshChannelCoreAdjustSendCommit(pChannel, iBytes);

xrtSshChannelCoreAdjustReceiveCommit

提交已验证的 peer WINDOW_ADJUST。

xsshcode xrtSshChannelCoreAdjustReceiveCommit( xsshchannelcore* pChannel, const xsshchanneladjust* pAdjust );
参数说明
xsshchannelcore* pChannel通道对象
const xsshchanneladjust* pAdjustAdjust 参数
返回:提交已验证的 peer WINDOW_ADJUST。

示例已编译验证

/* 提交已验证的 peer WINDOW_ADJUST。 */
result = xrtSshChannelCoreAdjustReceiveCommit(pChannel, pAdjust);

xrtSshChannelCoreCanSendRequest

判断当前方向是否还能发送或接收 channel request。

bool xrtSshChannelCoreCanSendRequest( const xsshchannelcore* pChannel );
参数说明
const xsshchannelcore* pChannel通道对象
返回:判断当前方向是否还能发送或接收 channel request。

示例已编译验证

/* 判断当前方向是否还能发送或接收 channel request。 */
result = xrtSshChannelCoreCanSendRequest(pChannel);

xrtSshChannelCoreCanReceiveRequest

XRT_API bool xrtSshChannelCoreCanReceiveRequest( const xsshchannelcore* pChannel );

;
返回:XRT_API bool xrtSshChannelCoreCanReceiveRequest( const xsshchannelcore* pChannel );

示例已编译验证

/* XRT_API bool xrtSshChannelCoreCanReceiveRequest( const xsshchannelcore* pChannel ); */
result = xrtSshChannelCoreCanReceiveRequest();

xrtSshChannelCoreRecipientCheck

校验已解析 peer channel 消息的 recipient,不推进状态。

xsshcode xrtSshChannelCoreRecipientCheck( const xsshchannelcore* pChannel, uint32 iRecipient );
参数说明
const xsshchannelcore* pChannel通道对象
uint32 iRecipient收件人通道号
返回:校验已解析 peer channel 消息的 recipient,不推进状态。

示例已编译验证

/* 校验已解析 peer channel 消息的 recipient,不推进状态。 */
result = xrtSshChannelCoreRecipientCheck(pChannel, iRecipient);

xrtSshChannelCoreEofSendCommit

EOF 可靠排队或验证接收后提交对应方向的半关闭。

xsshcode xrtSshChannelCoreEofSendCommit( xsshchannelcore* pChannel );
参数说明
xsshchannelcore* pChannel通道对象
返回:EOF 可靠排队或验证接收后提交对应方向的半关闭。

示例已编译验证

/* EOF 可靠排队或验证接收后提交对应方向的半关闭。 */
result = xrtSshChannelCoreEofSendCommit(pChannel);

xrtSshChannelCoreEofReceiveCommit

XRT_API xsshcode xrtSshChannelCoreEofReceiveCommit( xsshchannelcore* pChannel, uint32 iRecipient );

;
返回:XRT_API xsshcode xrtSshChannelCoreEofReceiveCommit( xsshchannelcore* pChannel, uint32 iRecipient );

示例已编译验证

/* XRT_API xsshcode xrtSshChannelCoreEofReceiveCommit( xsshchannelcore* pChannel, uint32 iRecipient ); */
result = xrtSshChannelCoreEofReceiveCommit();

xrtSshChannelCoreCloseSendCommit

CLOSE 可靠排队或验证接收后提交;双向完成时进入 CLOSED。

xsshcode xrtSshChannelCoreCloseSendCommit( xsshchannelcore* pChannel );
参数说明
xsshchannelcore* pChannel通道对象
返回:CLOSE 可靠排队或验证接收后提交;双向完成时进入 CLOSED。

示例已编译验证

/* CLOSE 可靠排队或验证接收后提交;双向完成时进入 CLOSED。 */
result = xrtSshChannelCoreCloseSendCommit(pChannel);

xrtSshChannelCoreCloseReceiveCommit

XRT_API xsshcode xrtSshChannelCoreCloseReceiveCommit( xsshchannelcore* pChannel, uint32 iRecipient );

;
返回:XRT_API xsshcode xrtSshChannelCoreCloseReceiveCommit( xsshchannelcore* pChannel, uint32 iRecipient );

示例已编译验证

/* XRT_API xsshcode xrtSshChannelCoreCloseReceiveCommit( xsshchannelcore* pChannel, uint32 iRecipient ); */
result = xrtSshChannelCoreCloseReceiveCommit();