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();
|
|
|
|
|
acl::log::stdout_open(true);
|
|
|
|
|
|
|
|
|
|
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_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
|
|
|
|
|
2016-04-12 20:11:15 +08:00
|
|
|
|
if (argc >= 2 && strcmp(argv[1], "help") == 0)
|
|
|
|
|
printf("usage: %s addr conf\r\n", argv[0]);
|
|
|
|
|
else if (argc >= 2 && strcmp(argv[1], "alone") == 0)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
|
|
|
|
const char* addr = "127.0.0.1:8888";
|
|
|
|
|
if (argc >= 3)
|
|
|
|
|
addr = argv[2];
|
|
|
|
|
printf("listen on: %s\r\n", addr);
|
2016-04-12 20:11:15 +08:00
|
|
|
|
|
|
|
|
|
const char* conf = "master_http_aio.cf";
|
|
|
|
|
if (argc >= 4)
|
|
|
|
|
conf = argv[3];
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ms.run_alone(addr, conf, acl::ENGINE_KERNEL); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
2014-11-19 00:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
2015-02-11 09:28:05 +08:00
|
|
|
|
{
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
const char* addr = "127.0.0.1:8888";
|
|
|
|
|
printf("listen on: %s\r\n", addr);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ms.run_alone(addr, NULL, acl::ENGINE_SELECT); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
2015-02-11 09:28:05 +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>
|
2015-02-11 09:28:05 +08:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|