本文整理汇总了C++中TestIntfPrx::deactivate方法的典型用法代码示例。如果您正苦于以下问题:C++ TestIntfPrx::deactivate方法的具体用法?C++ TestIntfPrx::deactivate怎么用?C++ TestIntfPrx::deactivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestIntfPrx
的用法示例。
在下文中一共展示了TestIntfPrx::deactivate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
TestIntfPrx
allTests(const CommunicatorPtr& communicator)
{
cout << "testing stringToProxy... " << flush;
ObjectPrx base = communicator->stringToProxy("test:default -p 12010");
test(base);
cout << "ok" << endl;
cout << "testing checked cast... " << flush;
TestIntfPrx obj = TestIntfPrx::checkedCast(base);
test(obj);
test(obj == base);
cout << "ok" << endl;
{
cout << "creating/destroying/recreating object adapter... " << flush;
ObjectAdapterPtr adapter =
communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
try
{
communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
test(false);
}
catch(const AlreadyRegisteredException&)
{
}
adapter->destroy();
//
// Use a different port than the first adapter to avoid an "address already in use" error.
//
adapter = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
adapter->destroy();
cout << "ok" << endl;
}
cout << "creating/activating/deactivating object adapter in one operation... " << flush;
obj->transient();
cout << "ok" << endl;
{
cout << "testing connection closure... " << flush;
for(int i = 0; i < 10; ++i)
{
Ice::InitializationData initData;
initData.properties = communicator->getProperties()->clone();
Ice::CommunicatorPtr comm = Ice::initialize(initData);
comm->stringToProxy("test:default -p 12010")->begin_ice_ping();
comm->destroy();
}
cout << "ok" << endl;
}
cout << "deactivating object adapter in the server... " << flush;
obj->deactivate();
cout << "ok" << endl;
cout << "testing whether server is gone... " << flush;
try
{
obj->ice_ping();
test(false);
}
catch(const LocalException&)
{
cout << "ok" << endl;
}
return obj;
}