本文整理汇总了C++中AdminPrx::pingNode方法的典型用法代码示例。如果您正苦于以下问题:C++ AdminPrx::pingNode方法的具体用法?C++ AdminPrx::pingNode怎么用?C++ AdminPrx::pingNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminPrx
的用法示例。
在下文中一共展示了AdminPrx::pingNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
//.........这里部分代码省略.........
nodeApp.serverTemplates["nodeTemplate"].descriptor = server;
nodeApp.serverTemplates["nodeTemplate"].parameters.push_back("index");
ServerInstanceDescriptor instance;
instance._cpp_template = "nodeTemplate";
instance.parameterValues["index"] = "1";
nodeApp.nodes["localnode"].serverInstances.push_back(instance);
instance.parameterValues["index"] = "2";
nodeApp.nodes["localnode"].serverInstances.push_back(instance);
try
{
admin->addApplication(nodeApp);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
test(false);
}
admin->startServer("node-1");
admin->startServer("node-2");
//
// We need to wait because the node might not be fully started
// here (the node adapter isn't indirect, so we can't use the
// wait-for-activation feature here.)
//
int retry = 0;
while(retry < 20)
{
try
{
if(admin->pingNode("node-1") && admin->pingNode("node-2"))
{
break;
}
}
catch(const NodeNotExistException&)
{
}
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(500));
++retry;
}
test(admin->pingNode("node-1"));
test(admin->pingNode("node-2"));
ApplicationDescriptor testApp;
testApp.name = "TestApp";
server = new ServerDescriptor();
server->id = "Server";
server->exe = properties->getProperty("TestDir") + "/server";
server->pwd = ".";
server->applicationDistrib = false;
server->allocatable = false;
addProperty(server, "Ice.Admin.Endpoints", "tcp -h 127.0.0.1");
AdapterDescriptor adapter;
adapter.name = "Server";
adapter.id = "ServerAdapter";
adapter.registerProcess = false;
adapter.serverLifetime = true;
server->adapters.push_back(adapter);
addProperty(server, "Server.Endpoints", "default");
testApp.nodes["node-1"].servers.push_back(server);
try