���߳��첽 PING �����ַ�ĺ������ */
| 64 | |
| 65 | /* ���߳��첽 PING �����ַ�ĺ������ */ |
| 66 | static void ping_main_async(const ACL_ARGV *ip_list, int npkt) |
| 67 | { |
| 68 | ACL_AIO *aio; |
| 69 | |
| 70 | /* �����������첽ͨ�ž�� */ |
| 71 | aio = acl_aio_create(ACL_EVENT_SELECT); |
| 72 | acl_aio_set_keep_read(aio, 0); |
| 73 | |
| 74 | /* ���� ICMP ���� */ |
| 75 | __chat = icmp_chat_create(aio, 1); |
| 76 | |
| 77 | /* ������Ҫ PING �ĵ�ַ�б� */ |
| 78 | add_ip_list(__chat, ip_list, npkt); |
| 79 | |
| 80 | while (1) { |
| 81 | /* ��� PING ���������˳�ѭ�� */ |
| 82 | if (icmp_chat_finish(__chat)) { |
| 83 | printf("over now!, hosts' size=%d, count=%d\r\n", |
| 84 | icmp_chat_size(__chat), icmp_chat_count(__chat)); |
| 85 | break; |
| 86 | } |
| 87 | |
| 88 | /* �첽�¼�ѭ������ */ |
| 89 | acl_aio_loop(aio); |
| 90 | } |
| 91 | |
| 92 | /* ��ʾ PING ��� */ |
| 93 | display_res(); |
| 94 | |
| 95 | /* ���ٷ�������� */ |
| 96 | acl_aio_free(aio); |
| 97 | } |
| 98 | |
| 99 | /* ���߳� PING ������ַ�ĺ������ */ |
| 100 | static void ping_main_sync(const char *dest, int npkt) |
no test coverage detected
searching dependent graphs…