本文整理汇总了C++中TestIntfPrx::begin_idempotentAbort方法的典型用法代码示例。如果您正苦于以下问题:C++ TestIntfPrx::begin_idempotentAbort方法的具体用法?C++ TestIntfPrx::begin_idempotentAbort怎么用?C++ TestIntfPrx::begin_idempotentAbort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestIntfPrx
的用法示例。
在下文中一共展示了TestIntfPrx::begin_idempotentAbort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
cb->check();
int pid = cb->pid();
test(pid != oldPid);
cout << "ok" << endl;
oldPid = pid;
}
if(j == 0)
{
if(!ami)
{
cout << "shutting down server #" << i << "... " << flush;
obj->shutdown();
cout << "ok" << endl;
}
else
{
cout << "shutting down server #" << i << " with AMI... " << flush;
CallbackPtr cb = new Callback;
obj->begin_shutdown(newCallback_TestIntf_shutdown(cb, &Callback::opShutdownI, &Callback::exception));
cb->check();
cout << "ok" << endl;
}
}
else if(j == 1 || i + 1 > ports.size())
{
if(!ami)
{
cout << "aborting server #" << i << "... " << flush;
try
{
obj->abort();
test(false);
}
catch(const Ice::ConnectionLostException&)
{
cout << "ok" << endl;
}
catch(const Ice::ConnectFailedException&)
{
cout << "ok" << endl;
}
}
else
{
cout << "aborting server #" << i << " with AMI... " << flush;
CallbackPtr cb = new Callback;
obj->begin_abort(newCallback_TestIntf_abort(cb, &Callback::response, &Callback::exceptAbortI));
cb->check();
cout << "ok" << endl;
}
}
else if(j == 2 || j == 3)
{
if(!ami)
{
cout << "aborting server #" << i << " and #" << i + 1 << " with idempotent call... " << flush;
try
{
obj->idempotentAbort();
test(false);
}
catch(const Ice::ConnectionLostException&)
{
cout << "ok" << endl;
}
catch(const Ice::ConnectFailedException&)
{
cout << "ok" << endl;
}
}
else
{
cout << "aborting server #" << i << " and #" << i + 1 << " with idempotent AMI call... " << flush;
CallbackPtr cb = new Callback;
obj->begin_idempotentAbort(newCallback_TestIntf_idempotentAbort(cb, &Callback::response,
&Callback::exceptAbortI));
cb->check();
cout << "ok" << endl;
}
++i;
}
else
{
assert(false);
}
}
cout << "testing whether all servers are gone... " << flush;
try
{
obj->ice_ping();
test(false);
}
catch(const Ice::LocalException&)
{
cout << "ok" << endl;
}
}