MCPcopy Create free account
hub / github.com/acl-dev/acl / init

Function init

lib_acl_cpp/samples/connect_manager/main.cpp:32–62  ·  view source on GitHub ↗

��ʼ������

Source from the content-addressed store, hash-verified

30
31// ��ʼ������
32static void init(const char* addrs, int max, int min, int ttl,
33 int check_type, const char* proto)
34{
35 // ���� HTTP �������ӳؼ�Ⱥ��������
36 __conn_manager = new connect_manager((size_t) min);
37
38 // ���ӷ�������Ⱥ��ַ
39 __conn_manager->init(addrs, addrs, (size_t) max);
40 __conn_manager->set_idle_ttl(ttl);
41
42 printf(">>>start monitor thread\r\n");
43
44 // ������̨����߳�
45 int check_inter = 1, conn_timeout = 5;
46
47 acl::connect_monitor* monitor = new mymonitor(*__conn_manager, proto,
48 check_type != 0);
49 monitor->set_check_inter(check_inter);
50 monitor->set_conn_timeout(conn_timeout);
51 monitor->set_check_conns(true, true, true, __threads);
52
53 if (check_type == 2) {
54 monitor->open_rpc_service(10, NULL);
55 }
56
57 (void) __conn_manager->start_monitor(monitor);
58
59 printf(">>>create thread pool\r\n");
60 // �����̳߳�
61 __thr_pool = acl_thread_pool_create(max, 60);
62}
63
64// �����˳�ǰ������Դ
65static void end(void)

Callers 1

mainFunction · 0.70

Calls 5

acl_thread_pool_createFunction · 0.85
set_idle_ttlMethod · 0.80
start_monitorMethod · 0.80
initMethod · 0.45
set_check_interMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…