| 170 | } |
| 171 | |
| 172 | int main(int argc, char* argv[]) |
| 173 | { |
| 174 | int ch, max = 10, min = 0, ttl = 60; |
| 175 | int check_type = 0, delay = 2; |
| 176 | acl::string addrs("www.sina.com.cn:80;www.263.net:80;www.qq.com:81"); |
| 177 | acl::string proto("pop3"); |
| 178 | |
| 179 | // ��ʼ�� acl �� |
| 180 | acl::acl_cpp_init(); |
| 181 | |
| 182 | // ��־���������� |
| 183 | acl::log::stdout_open(true); |
| 184 | |
| 185 | while ((ch = getopt(argc, argv, "hs:n:c:m:t:o:p:d:C")) > 0) { |
| 186 | switch (ch) { |
| 187 | case 'h': |
| 188 | usage(argv[0]); |
| 189 | return 0; |
| 190 | case 's': |
| 191 | addrs = optarg; |
| 192 | break; |
| 193 | case 'c': |
| 194 | max = atoi(optarg); |
| 195 | break; |
| 196 | case 'o': |
| 197 | ttl = atoi(optarg); |
| 198 | break; |
| 199 | case 'm': |
| 200 | min = atoi(optarg); |
| 201 | break; |
| 202 | case 'n': |
| 203 | __loop_count = atoi(optarg); |
| 204 | break; |
| 205 | case 't': |
| 206 | check_type = atoi(optarg); |
| 207 | break; |
| 208 | case 'p': |
| 209 | proto = optarg; |
| 210 | break; |
| 211 | case 'd': |
| 212 | delay = atoi(optarg); |
| 213 | break; |
| 214 | case 'C': |
| 215 | __threads = new acl::thread_pool; |
| 216 | __threads->set_limit(20); |
| 217 | __threads->set_idle(120); |
| 218 | __threads->start(); |
| 219 | break; |
| 220 | default: |
| 221 | usage(argv[0]); |
| 222 | return 0; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | init(addrs, max, min, ttl, check_type, proto); |
| 227 | run(max, delay); |
| 228 | end(); |
| 229 |
nothing calls this directly
no test coverage detected
searching dependent graphs…