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

Function ping_main_async

lib_protocol/samples/ping/main.c:66–97  ·  view source on GitHub ↗

���߳��첽 PING �����ַ�ĺ������ */

Source from the content-addressed store, hash-verified

64
65/* ���߳��첽 PING �����ַ�ĺ������ */
66static 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 ������ַ�ĺ������ */
100static void ping_main_sync(const char *dest, int npkt)

Callers 1

mainFunction · 0.85

Calls 10

acl_aio_createFunction · 0.85
acl_aio_set_keep_readFunction · 0.85
icmp_chat_createFunction · 0.85
add_ip_listFunction · 0.85
icmp_chat_finishFunction · 0.85
icmp_chat_sizeFunction · 0.85
icmp_chat_countFunction · 0.85
acl_aio_loopFunction · 0.85
acl_aio_freeFunction · 0.85
display_resFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…