void CDlgPpro::OnBnClickedJointableButton() { // I'm not yet joined to a table, so try to join if (p_pokerpro->ppdata()->m_tinf.m_tid == 0) { DoTableSelect(); } // I'm joined, so unjoin else { // log OH title bar text and table reset write_log(1, "%s - %s(NOT ATTACHED)\n", p_formula->formula_name().GetString(), p_pokerpro->ppdata()->m_site_name); write_log(1, "TABLE RESET\n*************************************************************\n"); // Stop logging stop_log(); p_pokerpro->SendGoto(0); p_pokerpro->ResetHand(); p_pokerpro->set_ppdata_tinf_reset(); p_pokerpro->set_ppdata_reset_userchair(); p_pokerpro->set_ppdata_tinf_tid_reset(); } }
int COpenHoldemApp::ExitInstance() { DeleteAllSingletons(); stop_log(); Scintilla_ReleaseResources(); return CWinApp::ExitInstance(); }
void _log_fatal( const char* szSrc, int nSrcLine, const char* fmt, ... ) { va_list arg_ptr ; va_start( arg_ptr, fmt ) ; vfprintf( stderr, fmt,arg_ptr) ; fprintf( stderr, "\n"); va_end(arg_ptr); /* if (bDebug) { va_list arg_ptr ; log_print_prefix_f("fatal: ", szSrc); va_start( arg_ptr, fmt ) ; vfprintf(pFLog,fmt,arg_ptr) ; va_end(arg_ptr); //secmem_dump_stats(); } else { va_list arg_ptr ; log_print_prefix("fatal: "); va_start( arg_ptr, fmt ) ; vfprintf(pFLog,fmt,arg_ptr) ; va_end(arg_ptr); //secmem_dump_stats(); } fprintf(pFLog, "\n"); fflush(pFLog); */ stop_log(); error("An Exception was caugth, please see log file."); }
int main(int argc, char* argv[]) { if (argc < 4) { std::cout << "请按以下方式运行: 可执行文件名 current_node_path zookeeper_server_ip_port log_config_file" << std::endl << "current_node_path 一般为/auth/ip, ip为当前通讯端服务器的IP地址, 如/auth/116.255.130.148" << std::endl << "zookeeper_server_ip_port 逗号分隔的 IP:端口 标识, 每个关联一个 zookeeper 服务端, 如:127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" << "log_config_file 日志配置文件" << std::endl; boost::this_thread::sleep_for(boost::chrono::seconds(5)); return -1; } try { init_log(argv[3]); } catch (std::exception& e) { std::cout << e.what() << std::endl; boost::this_thread::sleep_for(boost::chrono::seconds(5)); return -1; } boost::shared_ptr<config_server> config_server_; try { config_server_ = boost::make_shared<config_server>(argv[1], argv[2]); } catch (std::runtime_error e) { BOOST_LOG_SEV(cia_g_logger, Critical) << "连接zookeeper服务器失败:" << e.what(); boost::this_thread::sleep_for(boost::chrono::seconds(5)); return -1; } // 等待zookeeper相关值初始化完毕 while (!config_server_->get_started()) { boost::this_thread::sleep_for(boost::chrono::seconds(1)); } boost::shared_ptr<boost::asio::io_service> p_io_service_ = boost::make_shared<boost::asio::io_service>(); boost::thread_group io_comppletions_thread_; boost::asio::io_service::work dummy_worker_(*p_io_service_); // 为了维持io_service线程池持续运行, 而设置的虚拟任务 int io_comppletions_thread_count = config_server_->get_cti_total_channel_count() * 2 + config_server_->get_iocp_thread_number(); while (io_comppletions_thread_count--) { io_comppletions_thread_.create_thread([p_io_service_]() { p_io_service_->run(); }); } //testNetLogic(config_server_, p_io_service_); //testCTI(config_server_, p_io_service_); test_all(config_server_, p_io_service_); //test_config_server(config_server_); boost::this_thread::sleep_for(boost::chrono::seconds(3)); config_server_->set_idol_channel_number(0); stop_log(); }