本文整理汇总了C++中portableinterceptor::ServerRequestInfo_ptr::get_reply_service_context方法的典型用法代码示例。如果您正苦于以下问题:C++ ServerRequestInfo_ptr::get_reply_service_context方法的具体用法?C++ ServerRequestInfo_ptr::get_reply_service_context怎么用?C++ ServerRequestInfo_ptr::get_reply_service_context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ServerRequestInfo_ptr
的用法示例。
在下文中一共展示了ServerRequestInfo_ptr::get_reply_service_context方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
Echo_Server_Request_Interceptor::send_exception (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
CORBA::String_var operation = ri->operation ();
#if 0
ACE_DEBUG ((LM_DEBUG,
"%C.send_exception from \"%C\"\n",
this->myname_,
operation.in ()));
#endif /*if 0*/
// Check that the reply service context is set as expected.
IOP::ServiceContext_var sc =
ri->get_reply_service_context (::service_id);
const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ());
#if 0
ACE_DEBUG ((LM_DEBUG,
" Reply service context: %C\n",
buf));
#endif /*if 0*/
if (ACE_OS::strcmp (buf, reply_msg) != 0)
{
ACE_ERROR ((LM_ERROR,
"ERROR: Echo_Server_Request_Interceptor::send_exception: "
"Expected reply service context to be: %C\n",
reply_msg));
}
// Check that the request service context hasn't been changed.
IOP::ServiceContext_var sc2 =
ri->get_request_service_context (::service_id);
const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ());
if (ACE_OS::strcmp (buf2, request_msg) != 0)
{
ACE_ERROR ((LM_ERROR,
"ERROR: Echo_Server_Request_Interceptor::send_exception: "
"Expected request service context to be: %C.\n"
" Got: %C\n",
request_msg,
buf2));
}
}