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

Function init

lib_acl_cpp/samples/http_request_manager/main.cpp:22–49  ·  view source on GitHub ↗

��ʼ������

Source from the content-addressed store, hash-verified

20
21// ��ʼ������
22static void init(const char* addrs, int count)
23{
24 int cocurrent = 100, conn_timeout = 100, rw_timeout = 200;
25
26 // ���� HTTP �������ӳؼ�Ⱥ��������
27 __conn_manager = new http_request_manager();
28
29 // ���ӷ�������Ⱥ��ַ
30 __conn_manager->init(addrs, addrs, cocurrent, conn_timeout, rw_timeout);
31
32 printf(">>>start monitor thread\r\n");
33
34 int check_inter = 1, check_conn_timeout = 5;
35 acl::connect_monitor* monitor = new acl::connect_monitor(*__conn_manager);
36 (*monitor).set_check_inter(check_inter).set_conn_timeout(check_conn_timeout);
37
38 // ������̨����߳�
39 __conn_manager->start_monitor(monitor);
40
41
42 int n = 2;
43 printf(">>>sleep %d seconds for monitor check\r\n", n);
44 sleep_while(n);
45
46 printf(">>>create thread pool\r\n");
47 // �����̳߳�
48 __thr_pool = acl_thread_pool_create(count, 60);
49}
50
51// �����˳�ǰ������Դ
52static void end(void)

Callers 1

mainFunction · 0.70

Calls 5

acl_thread_pool_createFunction · 0.85
start_monitorMethod · 0.80
sleep_whileFunction · 0.70
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…