2019-07-28 10:31:56 +08:00
|
|
|
|
#include "stdafx.h"
|
2016-09-20 19:55:38 +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><>
|
2016-09-20 19:55:38 +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>
|
2016-09-20 19:55:38 +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>
|
2016-09-20 19:55:38 +08:00
|
|
|
|
|
2019-06-10 13:00:25 +08:00
|
|
|
|
if (argc >= 2 && strcasecmp(argv[1], "help") == 0) {
|
2016-10-21 15:02:50 +08:00
|
|
|
|
printf("usage: %s alone [configure [listen_addr]]\r\n", argv[0]);
|
|
|
|
|
return 0;
|
2019-06-10 13:00:25 +08:00
|
|
|
|
} else if (argc >= 2 && strcasecmp(argv[1], "alone") == 0) {
|
2019-07-28 10:31:56 +08:00
|
|
|
|
acl::log::stdout_open(true); // <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
2016-09-20 19:55:38 +08:00
|
|
|
|
|
|
|
|
|
const char* conf = NULL;
|
|
|
|
|
if (argc >= 3)
|
|
|
|
|
conf = argv[2];
|
|
|
|
|
|
2019-06-10 13:00:25 +08:00
|
|
|
|
const char* addr = "0.0.0.0:8885";
|
2016-09-20 19:55:38 +08:00
|
|
|
|
if (argc >= 4)
|
2016-10-21 15:02:50 +08:00
|
|
|
|
addr = argv[3];
|
2016-09-20 19:55:38 +08:00
|
|
|
|
|
|
|
|
|
printf("listen on: %s\r\n", addr);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ms.run_alone(addr, conf, 0, 1000); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
2016-09-20 19:55:38 +08:00
|
|
|
|
|
|
|
|
|
printf("Enter any key to exit now\r\n");
|
|
|
|
|
getchar();
|
2019-06-10 13:00:25 +08:00
|
|
|
|
} else {
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ms.run_daemon(argc, argv); // acl_master <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
|
2019-06-10 13:00:25 +08:00
|
|
|
|
}
|
2016-09-20 19:55:38 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|