acl/app/wizard_demo/fiber_chat/main.cpp

35 lines
814 B
C++
Raw Normal View History

#include "stdafx.h"
2016-09-23 22:04:07 +08:00
#include "configure.h"
2016-09-20 19:55:38 +08:00
#include "master_service.h"
int main(int argc, char *argv[])
{
acl::acl_cpp_init();
master_service& ms = acl::singleton2<master_service>::get_instance();
// 设置配置参数表
2016-09-20 19:55:38 +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);
if (argc >= 2 && strcasecmp(argv[1], "help") == 0)
printf("usage: %s alone configure addr\r\n", argv[0]);
else if (argc >= 2 && strcasecmp(argv[1], "alone") == 0)
{
const char* addr = ":9001";
acl::log::stdout_open(true);
if (argc >= 4)
addr = argv[3];
printf("listen: %s\r\n", addr);
2022-02-10 09:50:00 +08:00
ms.run_alone(addr, argc >= 3 ? argv[2] : NULL);
2016-09-20 19:55:38 +08:00
}
else
ms.run_daemon(argc, argv);
return 0;
}