2019-07-28 10:31:56 +08:00
|
|
|
#include "stdafx.h"
|
2019-03-14 15:24:11 +08:00
|
|
|
#include "master_service.h"
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2022-07-22 23:15:27 +08:00
|
|
|
printf("ACL_VSTRING=%zd, acl::string=%zd, std::string=%zd\r\n",
|
|
|
|
sizeof(ACL_VSTRING), sizeof(acl::string), sizeof(std::string));
|
2019-03-14 15:24:11 +08:00
|
|
|
acl::acl_cpp_init();
|
|
|
|
master_service& ms = acl::singleton2<master_service>::get_instance();
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2022-01-18 23:58:40 +08:00
|
|
|
if (argc >= 2 && strcasecmp(argv[1], "alone") == 0) {
|
2022-08-26 17:51:41 +08:00
|
|
|
const char* addr = "80; 443";
|
2019-03-14 15:24:11 +08:00
|
|
|
|
|
|
|
acl::log::stdout_open(true);
|
2022-02-15 22:34:10 +08:00
|
|
|
acl::fiber::stdout_open(true);
|
2019-03-14 15:24:11 +08:00
|
|
|
|
2022-02-15 22:34:10 +08:00
|
|
|
if (argc >= 4) {
|
2019-03-14 15:24:11 +08:00
|
|
|
addr = argv[3];
|
2022-02-15 22:34:10 +08:00
|
|
|
}
|
2019-03-14 15:24:11 +08:00
|
|
|
printf("listen: %s\r\n", addr);
|
|
|
|
|
|
|
|
ms.run_alone(addr, argc >= 3 ? argv[2] : NULL);
|
2022-01-18 23:58:40 +08:00
|
|
|
} else {
|
2019-03-14 15:24:11 +08:00
|
|
|
ms.run_daemon(argc, argv);
|
2022-01-18 23:58:40 +08:00
|
|
|
}
|
2019-03-14 15:24:11 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|