mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-15 17:30:53 +08:00
43 lines
1018 B
C++
43 lines
1018 B
C++
|
#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], "help") == 0)
|
|||
|
printf("usage: %s alone addr conf_file\r\n", argv[0]);
|
|||
|
else if (argc >= 2 && strcmp(argv[1], "alone") == 0)
|
|||
|
{
|
|||
|
acl::log::stdout_open(true); // <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
const char* addr = "0.0.0.0:443";
|
|||
|
if (argc >= 3)
|
|||
|
addr = argv[2];
|
|||
|
printf("listen on: %s\r\n", addr);
|
|||
|
|
|||
|
if (argc >= 4)
|
|||
|
ms.run_alone(addr, argv[3], 0, 100); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
|||
|
else
|
|||
|
ms.run_alone(addr, NULL, 0, 100); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
|
|||
|
|
|||
|
printf("Enter any key to exit now\r\n");
|
|||
|
getchar();
|
|||
|
}
|
|||
|
else
|
|||
|
ms.run_daemon(argc, argv); // acl_master <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|