本文整理汇总了C++中TestConnections::connect_readconn_master方法的典型用法代码示例。如果您正苦于以下问题:C++ TestConnections::connect_readconn_master方法的具体用法?C++ TestConnections::connect_readconn_master怎么用?C++ TestConnections::connect_readconn_master使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestConnections
的用法示例。
在下文中一共展示了TestConnections::connect_readconn_master方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(100);
Test->repl->connect();
Test->tprintf("Connecting to ReadConnnRouter in 'master' mode\n");
Test->connect_readconn_master();
printf("Sleeping 10 seconds\n");
Test->stop_timeout();
sleep(10);
Test->set_timeout(50);
Test->add_result(check_connnections_only_to_master(Test, 0), "connections are not only to Master\n");
Test->close_readconn_master();
Test->tprintf("Changing master to node 1\n");
Test->set_timeout(50);
Test->repl->change_master(1, 0);
printf("Sleeping 10 seconds\n");
Test->stop_timeout();
sleep(10);
Test->set_timeout(50);
printf("Connecting to ReadConnnRouter in 'master' mode\n");
Test->connect_readconn_master();
printf("Sleeping 10 seconds\n");
Test->stop_timeout();
sleep(10);
Test->set_timeout(50);
Test->add_result(check_connnections_only_to_master(Test, 1), "connections are not only to master");
Test->close_readconn_master();
Test->set_timeout(50);
printf("Changing master back to node 0\n");
Test->repl->change_master(0, 1);
Test->check_log_err((char *) "The service 'CLI' is missing a definition of the servers", false);
int rval = Test->global_result;
delete Test;
return rval;
}