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


C++ TAO_ServerRequest::is_queued方法代码示例

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


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

示例1:

TAO::CSD::Strategy_Base::DispatchResult
TAO_DTP_POA_Strategy::dispatch_remote_request_i
                             (TAO_ServerRequest&              server_request,
                              const PortableServer::ObjectId& object_id,
                              PortableServer::POA_ptr         poa,
                              const char*                     operation,
                              PortableServer::Servant         servant)
{
  TAO::CSD::TP_Servant_State::HandleType servant_state =
                        this->get_servant_state (servant);

  // Handle the one ways that are SYNC_WITH_SERVER and not collocated.
  // before queuing the request and thus avoid delaying the client.
  // This is a problem if the servant ends up throwing a Location Forward
  // exception. If necessary, add an override config option here.
  CORBA::Boolean early_sync = true;
  server_request.is_queued (early_sync);
  server_request.sync_before_dispatch ();

  // Now we can create the TP_Remote_Request object, and then add it to our
  // task_'s "request queue".
  //
  // TBD-CSD: Need to use a Cached Allocator to "create" the
  //          TP_Remote_Request objects.  For now, use the heap.
  TAO::CSD::TP_Remote_Request *req_ptr;
  ACE_NEW_RETURN (req_ptr,
                  TAO::CSD::TP_Remote_Request (server_request,
                                               object_id,
                                               poa,
                                               operation,
                                               servant,
                                               servant_state.in ()),
                  TAO::CSD::Strategy_Base::DISPATCH_REJECTED);

  TAO::CSD::TP_Remote_Request_Handle request = req_ptr;

  // Hand the request object to our task so that it can add the request
  // to its "request queue".
  if (!this->dtp_task_.add_request (request.in ()))
    {
      // Return the DISPATCH_REJECTED return code so that the caller (our
      // base class' dispatch_request() method) knows that we did
      // not handle the request, and that it should be rejected.
      return TAO::CSD::Strategy_Base::DISPATCH_REJECTED;
    }

    return TAO::CSD::Strategy_Base::DISPATCH_HANDLED;
}
开发者ID:esohns,项目名称:ATCD,代码行数:48,代码来源:DTP_POA_Strategy.cpp


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