2014-11-19 00:25:21 +08:00
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "master_service.h"
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
|
|
|
|
// <20><>ʼ<EFBFBD><CABC> acl <20><>
|
|
|
|
|
acl::acl_cpp_init();
|
|
|
|
|
|
|
|
|
|
master_service& ms = acl::singleton2<master_service>::get_instance();
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
if (argc >= 2 && strcmp(argv[1], "alone") == 0)
|
|
|
|
|
{
|
2015-06-22 17:32:33 +08:00
|
|
|
|
// <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
|
|
|
|
acl::log::stdout_open(true);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2015-06-22 17:32:33 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ip:port1,ip:port2,...
|
2015-08-18 20:58:56 +08:00
|
|
|
|
const char* addrs = ":8888";
|
2015-06-22 17:32:33 +08:00
|
|
|
|
printf("listen on: %s\r\n", addrs);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2015-06-22 17:32:33 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
2014-11-19 00:25:21 +08:00
|
|
|
|
if (argc >= 3)
|
2015-06-22 17:32:33 +08:00
|
|
|
|
ms.run_alone(addrs, argv[2], acl::ENGINE_SELECT);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
else
|
2015-06-22 17:32:33 +08:00
|
|
|
|
ms.run_alone(addrs, NULL, acl::ENGINE_SELECT);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
printf("Enter any key to exit now\r\n");
|
|
|
|
|
getchar();
|
|
|
|
|
}
|
|
|
|
|
else
|
2015-02-11 09:28:05 +08:00
|
|
|
|
{
|
|
|
|
|
#ifdef WIN32
|
2015-06-22 17:32:33 +08:00
|
|
|
|
// <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
|
|
|
|
acl::log::stdout_open(true);
|
2015-02-11 09:28:05 +08:00
|
|
|
|
|
2015-06-22 17:32:33 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ip:port1,ip:port2,...
|
|
|
|
|
const char* addrs = "127.0.0.1:8888";
|
|
|
|
|
printf("listen on: %s\r\n", addrs);
|
2015-02-11 09:28:05 +08:00
|
|
|
|
|
2015-06-22 17:32:33 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
|
|
|
|
ms.run_alone(addrs, NULL, acl::ENGINE_SELECT);
|
2015-02-11 09:28:05 +08:00
|
|
|
|
|
|
|
|
|
printf("Enter any key to exit now\r\n");
|
|
|
|
|
getchar();
|
|
|
|
|
|
|
|
|
|
#else
|
2015-06-22 17:32:33 +08:00
|
|
|
|
// acl_master <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
|
|
|
|
|
ms.run_daemon(argc, argv);
|
2015-02-11 09:28:05 +08:00
|
|
|
|
#endif
|
2015-03-23 21:55:58 +08:00
|
|
|
|
}
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|