| 2 | #include "master_service.h" |
| 3 | |
| 4 | int main(int argc, char* argv[]) |
| 5 | { |
| 6 | // ��ʼ�� acl �� |
| 7 | acl::acl_cpp_init(); |
| 8 | |
| 9 | master_service& ms = acl::singleton2<master_service>::get_instance(); |
| 10 | |
| 11 | // ���������� |
| 12 | ms.set_cfg_int(var_conf_int_tab); |
| 13 | ms.set_cfg_int64(var_conf_int64_tab); |
| 14 | ms.set_cfg_str(var_conf_str_tab); |
| 15 | ms.set_cfg_bool(var_conf_bool_tab); |
| 16 | |
| 17 | // ��ʼ���� |
| 18 | |
| 19 | if (argc == 1 || (argc >= 2 && strcmp(argv[1], "alone") == 0)) { |
| 20 | // ��־���������� |
| 21 | acl::log::stdout_open(true); |
| 22 | // ��ֹ���� acl_master.log ��־ |
| 23 | acl::master_log_enable(false); |
| 24 | |
| 25 | // �����ĵ�ַ�б�����ʽ��ip|port1,ip|port2,... |
| 26 | const char* addrs = "|8888"; |
| 27 | printf("listen on: %s\r\n", addrs); |
| 28 | |
| 29 | // ����ʱ���ø�ֵ > 0 ��ָ�������������ͻ������ӹ��̵� |
| 30 | // �Ự������һ�����Ӵӽ��յ��رճ�֮Ϊһ���Ự������ |
| 31 | // ���������ӻỰ��������ֵ�����Թ��̽����������ֵ�� |
| 32 | // Ϊ 0������Թ�����Զ������ |
| 33 | unsigned int count = 0; |
| 34 | |
| 35 | // ���Թ�����ָ���̳߳�����̸߳��� |
| 36 | unsigned int max_threads = 100; |
| 37 | |
| 38 | // �������з�ʽ |
| 39 | |
| 40 | if (argc >= 3) { |
| 41 | ms.run_alone(addrs, argv[2], count, max_threads); |
| 42 | } else { |
| 43 | ms.run_alone(addrs, NULL, count, max_threads); |
| 44 | } |
| 45 | |
| 46 | printf("Enter any key to exit now\r\n"); |
| 47 | getchar(); |
| 48 | } else { |
| 49 | #if defined(_WIN32) || defined(_WIN64) |
| 50 | // ��־���������� |
| 51 | acl::log::stdout_open(true); |
| 52 | |
| 53 | // �����ĵ�ַ�б�����ʽ��ip:port1,ip:port2,... |
| 54 | const char* addrs = "127.0.0.1|8888"; |
| 55 | printf("listen on: %s\r\n", addrs); |
| 56 | |
| 57 | // ����ʱ���ø�ֵ > 0 ��ָ�������������ͻ������ӹ��̵� |
| 58 | // �Ự������һ�����Ӵӽ��յ��رճ�֮Ϊһ���Ự������ |
| 59 | // ���������ӻỰ��������ֵ�����Թ��̽����������ֵ�� |
| 60 | // Ϊ 0������Թ�����Զ������ |
| 61 | unsigned int count = 0; |
nothing calls this directly
no test coverage detected
searching dependent graphs…