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

Method accept_callback

lib_acl_cpp/samples/aio/pkg_server/main.cpp:160–180  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

158 * @return {bool} ���� true ��֪ͨ��������������
159 */
160 bool accept_callback(acl::aio_socket_stream* client)
161 {
162 // �����첽�ͻ������Ļص���������첽�����а�
163 io_callback* callback = new io_callback(client);
164
165 // ע���첽���Ķ��ص�����
166 client->add_read_callback(callback);
167
168 // ע���첽����д�ص�����
169 client->add_write_callback(callback);
170
171 // ע���첽���Ĺرջص�����
172 client->add_close_callback(callback);
173
174 // ע���첽���ij�ʱ�ص�����
175 client->add_timeout_callback(callback);
176
177 // ���첽�������ݰ�ͷ
178 client->read(sizeof(DAT_HDR), __timeout);
179 return true;
180 }
181};
182
183static 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