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

Method accept_callback

lib_acl_cpp/samples/aio/aio_echo/main.cpp:90–111  ·  view source on GitHub ↗

* �����麯�������������ӵ������ô˻ص����� * @param client {aio_socket_stream*} �첽�ͻ����� * @return {bool} ���� true ��֪ͨ�������������� */

Source from the content-addressed store, hash-verified

88 * @return {bool} ���� true ��֪ͨ��������������
89 */
90 bool accept_callback(acl::aio_socket_stream* client)
91 {
92 // �����첽�ͻ������Ļص���������첽�����а�
93 io_callback* callback = new io_callback(client);
94
95 // ע���첽���Ķ��ص�����
96 client->add_read_callback(callback);
97
98 // ע���첽����д�ص�����
99 client->add_write_callback(callback);
100
101 // ע���첽���Ĺرջص�����
102 client->add_close_callback(callback);
103
104 // ע���첽���ij�ʱ�ص�����
105 client->add_timeout_callback(callback);
106
107 // ���첽��������
108 int count = 0, timeout = 10;
109 client->read(count, timeout);
110 return true;
111 }
112};
113
114static void usage(const char* procname)

Callers

nothing calls this directly

Calls 5

add_read_callbackMethod · 0.80
add_write_callbackMethod · 0.80
add_close_callbackMethod · 0.80
add_timeout_callbackMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected