2019-07-27 22:44:32 +08:00
|
|
|
|
#include "stdafx.h"
|
2016-06-23 13:34:54 +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();
|
|
|
|
|
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// 璁剧疆閰嶇疆鍙傛暟琛<E69A9F>
|
2016-06-23 13:34:54 +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);
|
|
|
|
|
|
2019-07-20 16:41:23 +08:00
|
|
|
|
if (argc >= 2 && strcasecmp(argv[1], "alone") == 0) {
|
2019-07-27 19:32:56 +08:00
|
|
|
|
const char* addr = "|8887";
|
2016-06-23 13:34:54 +08:00
|
|
|
|
|
|
|
|
|
acl::log::stdout_open(true);
|
2019-07-20 16:41:23 +08:00
|
|
|
|
if (argc >= 4) {
|
2016-06-23 13:34:54 +08:00
|
|
|
|
addr = argv[3];
|
2019-07-20 16:41:23 +08:00
|
|
|
|
}
|
2016-06-23 13:34:54 +08:00
|
|
|
|
printf("listen: %s\r\n", addr);
|
|
|
|
|
|
2017-03-12 14:49:48 +08:00
|
|
|
|
ms.run_alone(addr, argc >= 3 ? argv[2] : NULL);
|
2019-07-20 16:41:23 +08:00
|
|
|
|
} else {
|
|
|
|
|
#if defined(_WIN32) || defined(_WIN64)
|
|
|
|
|
const char* addr = ":8887";
|
|
|
|
|
|
|
|
|
|
acl::log::stdout_open(true);
|
|
|
|
|
printf("listen: %s\r\n", addr);
|
|
|
|
|
|
|
|
|
|
ms.run_alone(addr, NULL);
|
|
|
|
|
#else
|
2016-06-23 13:34:54 +08:00
|
|
|
|
ms.run_daemon(argc, argv);
|
2019-07-20 16:41:23 +08:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2016-06-23 13:34:54 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|