xrtSshConnectionSessionInit

初始化无网络会话;全局 FIFO 必须为空,空 resolver 只允许 global 与新 channel open。

bool xrtSshConnectionSessionInit( xsshconnectionsession* pSession, xsshrole Role, xsshchannelresolveproc pResolve, ptr pUserData, xsshreplyqueue* pGlobalReplies );
参数说明
xsshconnectionsession* pSession会话对象
xsshrole Role本地角色
xsshchannelresolveproc pResolveResolve 参数
ptr pUserData透传用户数据
xsshreplyqueue* pGlobalRepliesGlobalReles 参数
返回:初始化无网络会话;全局 FIFO 必须为空,空 resolver 只允许 global 与新 channel open。

示例已编译验证

sshconnectionsessioninit obj;
xrtSshConnectionSessionInit(&obj, pSession, Role, pResolve, pUserData, pGlobalReplies);

xrtSshConnectionSessionClear

清除事务与借用指针,不清理调用方 channel 或 reply FIFO。

void xrtSshConnectionSessionClear(xsshconnectionsession* pSession);
参数说明
xsshconnectionsession* pSession会话对象
返回:清除事务与借用指针,不清理调用方 channel 或 reply FIFO。

示例已编译验证

/* 清除事务与借用指针,不清理调用方 channel 或 reply FIFO。 */
result = xrtSshConnectionSessionClear(pSession);

xrtSshConnectionSessionBegin

在 server USERAUTH_SUCCESS 已按正确方向提交后开放 connection 层。

xsshcode xrtSshConnectionSessionBegin( xsshconnectionsession* pSession, const xsshtransportcore* pCore );
参数说明
xsshconnectionsession* pSession会话对象
const xsshtransportcore* pCore核心对象
返回:在 server USERAUTH_SUCCESS 已按正确方向提交后开放 connection 层。

示例已编译验证

/* 在 server USERAUTH_SUCCESS 已按正确方向提交后开放 connection 层。 */
result = xrtSshConnectionSessionBegin(pSession, pCore);

xrtSshConnectionSessionActive

返回会话是否仍可处理 connection 消息。

bool xrtSshConnectionSessionActive( const xsshconnectionsession* pSession );
参数说明
const xsshconnectionsession* pSession会话对象
返回:返回会话是否仍可处理 connection 消息。

示例已编译验证

/* 返回会话是否仍可处理 connection 消息。 */
result = xrtSshConnectionSessionActive(pSession);

xrtSshConnectionSessionWritePrepare

XRT_API xsshcode xrtSshConnectionSessionWritePrepare( xsshconnectionsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, xsshchannelcore* pChannel, xsshreplyqueue* pReplies, uint64 iReplyToken );

;
返回:XRT_API xsshcode xrtSshConnectionSessionWritePrepare( xsshconnectionsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, xsshchannelcore* pChannel, xsshreplyqueue* pReplies, uint64 iReplyToken );

示例已编译验证

/* XRT_API xsshcode xrtSshConnectionSessionWritePrepare( xsshconnectionsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, xsshchannelcore* pChannel, xsshreplyqueue* pReplies, uint64 iReplyToken ); */
result = xrtSshConnectionSessionWritePrepare();

xrtSshConnectionSessionWriteCommit

transport 已可靠提交输出后,原子提交 channel 与 request FIFO 状态。

xsshcode xrtSshConnectionSessionWriteCommit( xsshconnectionsession* pSession, const xsshtransportcore* pCore );
参数说明
xsshconnectionsession* pSession会话对象
const xsshtransportcore* pCore核心对象
返回:transport 已可靠提交输出后,原子提交 channel 与 request FIFO 状态。

示例已编译验证

/* transport 已可靠提交输出后,原子提交 channel 与 request FIFO 状态。 */
result = xrtSshConnectionSessionWriteCommit(pSession, pCore);

xrtSshConnectionSessionWriteAbort

放弃未交给 transport 的输出,不修改 channel 或 reply FIFO。

xsshcode xrtSshConnectionSessionWriteAbort( xsshconnectionsession* pSession );
参数说明
xsshconnectionsession* pSession会话对象
返回:放弃未交给 transport 的输出,不修改 channel 或 reply FIFO。

示例已编译验证

/* 放弃未交给 transport 的输出,不修改 channel 或 reply FIFO。 */
result = xrtSshConnectionSessionWriteAbort(pSession);

xrtSshConnectionSessionReadPrepare

XRT_API xsshcode xrtSshConnectionSessionReadPrepare( xsshconnectionsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, xsshconnectionpacket* pPacket );

;
返回:XRT_API xsshcode xrtSshConnectionSessionReadPrepare( xsshconnectionsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, xsshconnectionpacket* pPacket );

示例已编译验证

/* XRT_API xsshcode xrtSshConnectionSessionReadPrepare( xsshconnectionsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, xsshconnectionpacket* pPacket ); */
result = xrtSshConnectionSessionReadPrepare();

xrtSshConnectionSessionReadCommit

transport 已提交输入后,原子提交 channel 与 reply FIFO 状态。

xsshcode xrtSshConnectionSessionReadCommit( xsshconnectionsession* pSession, const xsshtransportcore* pCore );
参数说明
xsshconnectionsession* pSession会话对象
const xsshtransportcore* pCore核心对象
返回:transport 已提交输入后,原子提交 channel 与 reply FIFO 状态。

示例已编译验证

/* transport 已提交输入后,原子提交 channel 与 reply FIFO 状态。 */
result = xrtSshConnectionSessionReadCommit(pSession, pCore);

xrtSshConnectionSessionReadAbort

放弃已认证输入并终止 connection 会话;对应 transport 也必须关闭。

xsshcode xrtSshConnectionSessionReadAbort( xsshconnectionsession* pSession );
参数说明
xsshconnectionsession* pSession会话对象
返回:放弃已认证输入并终止 connection 会话;对应 transport 也必须关闭。

示例已编译验证

/* 放弃已认证输入并终止 connection 会话;对应 transport 也必须关闭。 */
result = xrtSshConnectionSessionReadAbort(pSession);

xrtSshConnectionSessionFail

显式终止 connection 编排;重复调用保持失败状态。

void xrtSshConnectionSessionFail(xsshconnectionsession* pSession);
参数说明
xsshconnectionsession* pSession会话对象
返回:显式终止 connection 编排;重复调用保持失败状态。

示例已编译验证

/* 显式终止 connection 编排;重复调用保持失败状态。 */
result = xrtSshConnectionSessionFail(pSession);