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


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

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


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

示例1: AnscBdoGetBlockSize

ANSC_STATUS
HttpWstoRecv
    (
        ANSC_HANDLE                 hThisObject,
        PVOID                       buffer,
        ULONG                       ulSize,
        ANSC_HANDLE                 hBufferContext
    )
{
    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;
    PHTTP_WSP_INTERFACE             pWspIf        = (PHTTP_WSP_INTERFACE           )pMyObject->hWspIf;
    PANSC_DAEMON_SOCKET_TCP_OBJECT  pWebSocket    = (PANSC_DAEMON_SOCKET_TCP_OBJECT)pMyObject->hWebSocket;
    PANSC_BUFFER_DESCRIPTOR         pBufferDesp   = (PANSC_BUFFER_DESCRIPTOR       )hBufferContext;
    PHTTP_BMO_REQ_OBJECT            pBmoReq       = (PHTTP_BMO_REQ_OBJECT          )pMyObject->hBmoReq;
    ULONG                           ulBmoState    = HTTP_BMO_STATE_EMPTY;

    pBmoReq->SetFumIf((ANSC_HANDLE)pBmoReq, pSimpleServer->GetFumIf((ANSC_HANDLE)pSimpleServer));

    pBmoReq->SetWebSessionId((ANSC_HANDLE)pBmoReq, (ULONG)pMyObject->hWebsSession);

    /*
     * At time like this, you will always have two options on how to proceed with the message
     * processing:
     *
     *      $ Examine the current object states and the content of the message payload
     *        to make the processing decisions in this object.
     *
     *      $ Offload the examination and certain state-transition functions to another
     *        object and provide an interface to be notified when something happens.
     *
     * Guess which one we're using here ...
     */
    buffer       = AnscBdoGetBlock    (pBufferDesp);
    ulSize       = AnscBdoGetBlockSize(pBufferDesp);
    returnStatus =
        pBmoReq->Process
            (
                (ANSC_HANDLE)pBmoReq,
                (ANSC_HANDLE)pBufferDesp
            );

    if ( (returnStatus != ANSC_STATUS_SUCCESS    ) &&
         (returnStatus != ANSC_STATUS_DO_IT_AGAIN) )
    {
        pMyObject->TransState = HTTP_WSTO_STATE_FINISHED;
    }

    if ( (pMyObject->TransState == HTTP_WSTO_STATE_ESTABLISHED) ||
         (pMyObject->TransState == HTTP_WSTO_STATE_FINISHED   ) )
    {
        /*
         * To avoid unnessary memory consumption, we release the resources allocated for this
         * transaction right away...
         */
        pMyObject->Close((ANSC_HANDLE)pMyObject);
    }

    return  returnStatus;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:61,代码来源:http_wsto_process.c


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