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

40 lines
855 B
C++
Raw Normal View History

2014-11-19 00:25:21 +08:00
#include "stdafx.h"
#include "master_service.h"
int main(int argc, char* argv[])
{
// <20><>ʼ<EFBFBD><CABC> acl <20><>
acl::acl_cpp_init();
acl::log::stdout_open(true);
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_bool(var_conf_bool_tab);
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
if (argc >= 2 && strcmp(argv[1], "alone") == 0)
{
const char* addr = "127.0.0.1:8888";
if (argc >= 3)
addr = argv[2];
printf("listen on: %s\r\n", addr);
ms.run_alone(addr, NULL, acl::ENGINE_SELECT); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
}
else
{
#ifdef WIN32
const char* addr = "127.0.0.1:8888";
printf("listen on: %s\r\n", addr);
ms.run_alone(addr, NULL, acl::ENGINE_SELECT); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD>ʽ
#else
2014-11-19 00:25:21 +08:00
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;
}