本文整理汇总了C++中portableinterceptor::ClientRequestInfo_ptr::response_expected方法的典型用法代码示例。如果您正苦于以下问题:C++ ClientRequestInfo_ptr::response_expected方法的具体用法?C++ ClientRequestInfo_ptr::response_expected怎么用?C++ ClientRequestInfo_ptr::response_expected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ClientRequestInfo_ptr
的用法示例。
在下文中一共展示了ClientRequestInfo_ptr::response_expected方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
void
Client_Request_Interceptor::receive_other (
PortableInterceptor::ClientRequestInfo_ptr ri)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("CRI: in receive_other\n")));
CORBA::Boolean response_expected =
ri->response_expected ();
// Oneway
if (!response_expected)
return;
PortableInterceptor::ReplyStatus reply_status;
try
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("CRI: in receive_other, before reply_status\n")));
reply_status = ri->reply_status ();
ACE_UNUSED_ARG (reply_status);
}
catch(CORBA::BAD_INV_ORDER const &e)
{
e._tao_print_exception ("CRI: exception");
}
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("CRI: in receive_other, after reply_status\n")));
}
示例2: ForwardRequest
void
Client_Request_Interceptor::send_request (
PortableInterceptor::ClientRequestInfo_ptr ri)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("CRI: in send_request\n")));
++this->request_count_;
CORBA::Boolean response_expected =
ri->response_expected ();
if (!response_expected) // A one-way request.
return;
// Request 1 -- non-forwarded
// Request 2 -- forwarded by this interception point.
// Request 3 -- non-forwarded
if (this->request_count_ == 2)
{
if (CORBA::is_nil (this->orb_.in ()))
{
int argc = 0;
char **const argv= 0;
this->orb_ = CORBA::ORB_init (argc,
argv,
this->orb_id_.in ());
}
CORBA::Object_var forward =
this->orb_->string_to_object (this->forward_str_.in ());
CORBA::String_var forward_str =
this->orb_->object_to_string (forward.in ());
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("CRI: request %d will be forwarded via send_request()\n"),
this->request_count_));
// Notice that this is not a permanent forward.
throw PortableInterceptor::ForwardRequest (forward.in ());
}
}
示例3:
void
Client_Request_Interceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
{
// Test TC
test_transport_current (ACE_TEXT ("send_request"));
CORBA::Boolean const response_expected =
ri->response_expected ();
// Oneway?
if (response_expected)
ACE_DEBUG ((LM_DEBUG, ACE_TEXT("CRI (%P|%t) Sending a two-way\n")));
else
ACE_DEBUG ((LM_DEBUG, ACE_TEXT("CRI (%P|%t) Sending a one-way\n")));
// Make the context to send the context to the target
IOP::ServiceContext sc;
sc.context_id = Test::Transport::CurrentTest::ContextTag;
// How long can a number really get?
char temp[32];
{
ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_);
ACE_OS::sprintf (temp, "%ld", this->requestID_);
++this->requestID_;
}
CORBA::ULong string_len = ACE_OS::strlen (temp) + 1;
CORBA::Octet *buf = CORBA::OctetSeq::allocbuf (string_len);
ACE_OS::strcpy (reinterpret_cast <char *> (buf), temp);
sc.context_data.replace (string_len, string_len, buf, 1);
// Add this context to the service context list.
ri->add_request_service_context (sc, 0);
}