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

Method accept_callback

lib_acl_cpp/samples/http_server/http_server.cpp:101–131  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

99 * @return {bool} ���� true ��֪ͨ��������������
100 */
101 bool accept_callback(acl::aio_socket_stream* client)
102 {
103 // ������������߳���Ԥ��������������Ԥ����־λ
104 if (preread_)
105 {
106 ACL_VSTREAM* vstream = client->get_vstream();
107 vstream->flag |= ACL_VSTREAM_FLAG_PREREAD;
108 }
109
110 // �����첽�ͻ������Ļص���������첽�����а�
111 handle_io* callback = new handle_io(client);
112
113 // ע���첽���Ķ��ص�����
114 client->add_read_callback(callback);
115
116 // ע���첽����д�ص�����
117 client->add_write_callback(callback);
118
119 // ע���첽���Ĺرջص�����
120 client->add_close_callback(callback);
121
122 // ע���첽���ij�ʱ�ص�����
123 client->add_timeout_callback(callback);
124
125 rpc_read_wait_add();
126
127 // ����첽���Ƿ�ɶ�
128 client->read_wait(10);
129
130 return (true);
131 }
132
133private:
134 bool preread_;

Callers

nothing calls this directly

Calls 7

add_read_callbackMethod · 0.80
add_write_callbackMethod · 0.80
add_close_callbackMethod · 0.80
add_timeout_callbackMethod · 0.80
read_waitMethod · 0.80
rpc_read_wait_addFunction · 0.70
get_vstreamMethod · 0.45

Tested by

no test coverage detected