当前位置: 首页>>代码示例>>C++>>正文


C++ PHTTP_BMO_REQ_OBJECT::SetClientAddr方法代码示例

本文整理汇总了C++中PHTTP_BMO_REQ_OBJECT::SetClientAddr方法的典型用法代码示例。如果您正苦于以下问题:C++ PHTTP_BMO_REQ_OBJECT::SetClientAddr方法的具体用法?C++ PHTTP_BMO_REQ_OBJECT::SetClientAddr怎么用?C++ PHTTP_BMO_REQ_OBJECT::SetClientAddr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHTTP_BMO_REQ_OBJECT的用法示例。


在下文中一共展示了PHTTP_BMO_REQ_OBJECT::SetClientAddr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

ANSC_STATUS
HttpWstoOpen
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus  = ANSC_STATUS_SUCCESS;
    PHTTP_WEBS_TRANS_OBJECT         pMyObject     = (PHTTP_WEBS_TRANS_OBJECT       )hThisObject;
    PHTTP_SIMPLE_SERVER_OBJECT      pSimpleServer = (PHTTP_SIMPLE_SERVER_OBJECT    )pMyObject->hOwnerContext;
    PANSC_DAEMON_SOCKET_TCP_OBJECT  pWebSocket    = (PANSC_DAEMON_SOCKET_TCP_OBJECT)pMyObject->hWebSocket;
    PHTTP_HFP_INTERFACE             pHfpIf        = (PHTTP_HFP_INTERFACE           )pMyObject->hHfpIf;
    PHTTP_TMH_INTERFACE             pTmhIf        = (PHTTP_TMH_INTERFACE           )pMyObject->hTmhIf;
    PHTTP_BMO_REQ_OBJECT            pBmoReq       = (PHTTP_BMO_REQ_OBJECT          )pMyObject->hBmoReq;
    PHTTP_BMO_REP_OBJECT            pBmoRep       = (PHTTP_BMO_REP_OBJECT          )pMyObject->hBmoRep;
    HTTP_SIMPLE_SERVER_PROPERTY     httpSsoProperty;

    returnStatus =
        pSimpleServer->GetProperty
            (
                (ANSC_HANDLE)pSimpleServer,
                (ANSC_HANDLE)&httpSsoProperty
            );

    if ( !pBmoReq )
    {
        pBmoReq = (PHTTP_BMO_REQ_OBJECT)pSimpleServer->AcquireBmoReq((ANSC_HANDLE)pSimpleServer);

        if ( !pBmoReq )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            pMyObject->hBmoReq = (ANSC_HANDLE)pBmoReq;
        }

        pBmoReq->SetHfpIf        ((ANSC_HANDLE)pBmoReq, (ANSC_HANDLE)pHfpIf            );
        pBmoReq->SetTmhIf        ((ANSC_HANDLE)pBmoReq, (ANSC_HANDLE)pTmhIf            );
        pBmoReq->SetTransactionId((ANSC_HANDLE)pBmoReq, 0                              );
        pBmoReq->SetClientAddr   ((ANSC_HANDLE)pBmoReq, pWebSocket->PeerAddress.Dot    );
        pBmoReq->SetClientPort   ((ANSC_HANDLE)pBmoReq, pWebSocket->PeerPort           );
        pBmoReq->SetDaemonAddr   ((ANSC_HANDLE)pBmoReq, httpSsoProperty.HostAddress.Dot);
        pBmoReq->SetDaemonPort   ((ANSC_HANDLE)pBmoReq, httpSsoProperty.HostPort       );
        pBmoReq->SetServerMode   ((ANSC_HANDLE)pBmoReq, pSimpleServer->ServerMode      );
    }

    if ( !pBmoRep )
    {
        pBmoRep = (PHTTP_BMO_REP_OBJECT)pSimpleServer->AcquireBmoRep((ANSC_HANDLE)pSimpleServer);

        if ( !pBmoRep )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            pMyObject->hBmoRep = (ANSC_HANDLE)pBmoRep;
        }

        pBmoRep->SetHfpIf        ((ANSC_HANDLE)pBmoRep, (ANSC_HANDLE)pHfpIf);
        pBmoRep->SetTmhIf        ((ANSC_HANDLE)pBmoRep, (ANSC_HANDLE)pTmhIf);
        pBmoRep->SetTransactionId((ANSC_HANDLE)pBmoRep, 0                  );
    }

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:66,代码来源:http_wsto_operation.c


注:本文中的PHTTP_BMO_REQ_OBJECT::SetClientAddr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。