本文整理汇总了C++中TestIntfPrx::migrateHello方法的典型用法代码示例。如果您正苦于以下问题:C++ TestIntfPrx::migrateHello方法的具体用法?C++ TestIntfPrx::migrateHello怎么用?C++ TestIntfPrx::migrateHello使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestIntfPrx
的用法示例。
在下文中一共展示了TestIntfPrx::migrateHello方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
//.........这里部分代码省略.........
ic->stringToProxy("[email protected]")->ice_locatorCacheTimeout(1)->ice_ping(); // 1s timeout.
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(10));
}
}
catch(const Ice::LocalException&)
{
// Expected to fail once they endpoints have been updated in the background.
}
try
{
while(true)
{
ic->stringToProxy("test3")->ice_locatorCacheTimeout(1)->ice_ping(); // 1s timeout.
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(10));
}
}
catch(const Ice::LocalException&)
{
// Expected to fail once they endpoints have been updated in the background.
}
ic->destroy();
}
cout << "ok" << endl;
cout << "testing proxy from server after shutdown... " << flush;
hello = obj->getReplicatedHello();
obj->shutdown();
manager->startServer();
hello->sayHello();
cout << "ok" << endl;
cout << "testing object migration... " << flush;
hello = HelloPrx::checkedCast(communicator->stringToProxy("hello"));
obj->migrateHello();
// TODO: enable after fixing ICE-5489
//hello->ice_getConnection()->close(false);
hello->sayHello();
obj->migrateHello();
hello->sayHello();
obj->migrateHello();
hello->sayHello();
cout << "ok" << endl;
cout << "testing locator encoding resolution... " << flush;
hello = HelloPrx::checkedCast(communicator->stringToProxy("hello"));
count = locator->getRequestCount();
communicator->stringToProxy("[email protected]")->ice_encodingVersion(Ice::Encoding_1_1)->ice_ping();
test(count == locator->getRequestCount());
communicator->stringToProxy("[email protected]")->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping();
test(++count == locator->getRequestCount());
communicator->stringToProxy("test -e [email protected]")->ice_ping();
test(++count == locator->getRequestCount());
cout << "ok" << endl;
cout << "shutdown server... " << flush;
obj->shutdown();
cout << "ok" << endl;
cout << "testing whether server is gone... " << flush;
try
{
obj2->ice_ping();
test(false);
}
示例2: test
//.........这里部分代码省略.........
count += 2;
test(count == locator->getRequestCount());
communicator->stringToProxy("[email protected]")->ice_locatorCacheTimeout(-1)->ice_ping();
test(count == locator->getRequestCount());
communicator->stringToProxy("test")->ice_locatorCacheTimeout(-1)->ice_ping();
test(count == locator->getRequestCount());
communicator->stringToProxy("[email protected]")->ice_ping();
test(count == locator->getRequestCount());
communicator->stringToProxy("test")->ice_ping();
test(count == locator->getRequestCount());
test(communicator->stringToProxy("test")->ice_locatorCacheTimeout(99)->ice_getLocatorCacheTimeout() == 99);
cout << "ok" << endl;
cout << "testing proxy from server... " << flush;
HelloPrx hello = obj->getHello();
test(hello->ice_getAdapterId() == "TestAdapter");
hello->sayHello();
hello = obj->getReplicatedHello();
test(hello->ice_getAdapterId() == "ReplicatedAdapter");
hello->sayHello();
cout << "ok" << endl;
cout << "testing proxy from server after shutdown... " << flush;
obj->shutdown();
manager->startServer();
hello->sayHello();
cout << "ok" << endl;
cout << "testing object migration... " << flush;
hello = HelloPrx::checkedCast(communicator->stringToProxy("hello"));
obj->migrateHello();
hello->sayHello();
obj->migrateHello();
hello->sayHello();
obj->migrateHello();
hello->sayHello();
cout << "ok" << endl;
cout << "shutdown server... " << flush;
obj->shutdown();
cout << "ok" << endl;
cout << "testing whether server is gone... " << flush;
try
{
obj2->ice_ping();
test(false);
}
catch(const Ice::LocalException&)
{
}
try
{
obj3->ice_ping();
test(false);
}
catch(const Ice::LocalException&)
{
}
try
{
obj5->ice_ping();
test(false);