��ʼ������
| 20 | |
| 21 | // ��ʼ������ |
| 22 | static 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 | // �����˳�ǰ������Դ |
| 52 | static void end(void) |
no test coverage detected
searching dependent graphs…