acl/lib_acl_cpp/samples/master/master_http_threads/main.cpp

42 lines
969 B
C++
Raw Normal View History

#include "stdafx.h"
2014-11-19 00:25:21 +08:00
#include "master_service.h"
int main(int argc, char* argv[])
{
#if 0
acl_mem_slice_init(8, 1024, 100000,
ACL_SLICE_FLAG_GC2 |
ACL_SLICE_FLAG_RTGC_OFF |
ACL_SLICE_FLAG_LP64_ALIGN);
#endif
// <20><>ʼ<EFBFBD><CABC> acl <20><>
2014-11-19 00:25:21 +08:00
acl::acl_cpp_init();
master_service& ms = acl::singleton2<master_service>::get_instance();
// <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_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>
2014-11-19 00:25:21 +08:00
2021-01-17 18:57:37 +08:00
if (argc == 1 || (argc >= 2 && strcmp(argv[1], "alone") == 0)) {
const char* addr = "|8888";
2014-11-19 00:25:21 +08:00
printf("listen on: %s\r\n", addr);
ms.run_alone(addr, NULL, 0, 256); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
2021-01-17 18:57:37 +08:00
} else {
#ifdef WIN32
2021-01-17 18:57:37 +08:00
const char* addr = "|8888";
printf("listen on: %s\r\n", addr);
ms.run_alone(addr, NULL, 0, 256); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
#else
ms.run_daemon(argc, argv); // acl_master <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
#endif
}
2014-11-19 00:25:21 +08:00
return 0;
}