本文整理汇总了C++中Simple_Server_var::remote_call方法的典型用法代码示例。如果您正苦于以下问题:C++ Simple_Server_var::remote_call方法的具体用法?C++ Simple_Server_var::remote_call怎么用?C++ Simple_Server_var::remote_call使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simple_Server_var
的用法示例。
在下文中一共展示了Simple_Server_var::remote_call方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
try
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) == -1)
return -1;
CORBA::Object_var obj =
orb->string_to_object (proxy_ior);
if (obj.in () == 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
"The received object is nil\n"),
-1);
}
Simple_Server_var server =
Simple_Server::_narrow (obj.in ());
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
"Object reference is nil\n"),
-1);
}
try
{
while (true)
{
// Make a remote call
server->remote_call ();
ACE_OS::sleep (2);
}
}
catch (CORBA::TRANSIENT& ex)
{
CORBA::ULong m = ex.minor () & 0x00000F80u;
if (m == TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE &&
ex.completed () == CORBA::COMPLETED_NO)
{
ACE_DEBUG ((LM_DEBUG,
"TRANSIENT caught in client as it was expected.\n"));
}
else
{
ex._tao_print_exception ("Unexpected TRANSIENT caught in client:");
return 2;
}
}
obj =
orb->string_to_object (control_ior);
if (obj.in () == 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
"The received objref is NULL\n"),
-1);
}
server =
Simple_Server::_narrow (obj.in ());
server->shutdown ();
orb->destroy ();
}
catch (const CORBA::Exception & ex)
{
ex._tao_print_exception ("Exception caught in client:");
return 1;
}
return 0;
}