2019-07-28 10:31:56 +08:00
|
|
|
|
#include "stdafx.h"
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#include "master_service.h"
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><>ʼ<EFBFBD><CABC> acl <20><>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
acl::acl_cpp_init();
|
|
|
|
|
|
|
|
|
|
master_service& ms = acl::singleton2<master_service>::get_instance();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ms.set_cfg_int(var_conf_int_tab);
|
|
|
|
|
ms.set_cfg_int64(var_conf_int64_tab);
|
|
|
|
|
ms.set_cfg_str(var_conf_str_tab);
|
|
|
|
|
ms.set_cfg_bool(var_conf_bool_tab);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2021-01-17 18:57:37 +08:00
|
|
|
|
if (argc == 1 || (argc >= 2 && strcmp(argv[1], "alone") == 0)) {
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
2015-06-22 17:32:33 +08:00
|
|
|
|
acl::log::stdout_open(true);
|
2022-06-12 20:32:08 +08:00
|
|
|
|
// <20><>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD> acl_master.log <20><>־
|
|
|
|
|
acl::master_log_enable(false);
|
2015-06-22 17:32:33 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD>ֵ > 0 ʱ<>趨<EFBFBD><E8B6A8>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
// <20>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>ﵽ<EFBFBD><EFB5BD>ֵʱ<D6B5><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<=0) <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>һֱ<D2BB><D6B1><EFBFBD><EFBFBD>
|
2015-06-22 17:32:33 +08:00
|
|
|
|
int count = 5;
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪ<CEBB><CEAA><EFBFBD>룩
|
2015-06-22 17:32:33 +08:00
|
|
|
|
int interval = 1;
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
2019-07-20 16:41:23 +08:00
|
|
|
|
if (argc >= 3) {
|
2015-06-22 17:32:33 +08:00
|
|
|
|
ms.run_alone(argv[2], count, interval);
|
2019-07-20 16:41:23 +08:00
|
|
|
|
} else {
|
2015-06-22 17:32:33 +08:00
|
|
|
|
ms.run_alone(NULL, count, interval);
|
2019-07-20 16:41:23 +08:00
|
|
|
|
}
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
printf("Enter any key to exit now\r\n");
|
|
|
|
|
getchar();
|
2021-01-17 18:57:37 +08:00
|
|
|
|
} else {
|
2019-07-20 16:41:23 +08:00
|
|
|
|
#if defined(_WIN32) || defined(_WIN64)
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
2015-06-22 17:32:33 +08:00
|
|
|
|
acl::log::stdout_open(true);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD>ֵ > 0 ʱ<>趨<EFBFBD><E8B6A8>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
// <20>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>ﵽ<EFBFBD><EFB5BD>ֵʱ<D6B5><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<=0) <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>һֱ<D2BB><D6B1><EFBFBD><EFBFBD>
|
2015-06-22 17:32:33 +08:00
|
|
|
|
int count = 5;
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪ<CEBB><CEAA><EFBFBD>룩
|
2015-06-22 17:32:33 +08:00
|
|
|
|
int interval = 1;
|
2015-02-11 09:28:05 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
2015-06-22 17:32:33 +08:00
|
|
|
|
ms.run_alone(NULL, count, interval);
|
2015-02-11 09:28:05 +08:00
|
|
|
|
printf("Enter any key to exit now\r\n");
|
|
|
|
|
getchar();
|
|
|
|
|
#else
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// acl_master <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
|
2015-06-22 17:32:33 +08:00
|
|
|
|
ms.run_daemon(argc, argv);
|
2015-02-11 09:28:05 +08:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|