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

Method handle_client

lib_acl_cpp/samples/aio/aio_server/main.cpp:250–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249private:
250 bool handle_client(acl::aio_socket_stream* client)
251 {
252 // �����첽�ͻ������Ļص���������첽�����а�
253 io_callback* callback = new io_callback(client);
254
255 // ע���첽���Ķ��ص�����
256 client->add_read_callback(callback);
257
258 // ע���첽����д�ص�����
259 client->add_write_callback(callback);
260
261 // ע���첽���Ĺرջص�����
262 client->add_close_callback(callback);
263
264 // ע���첽���ij�ʱ�ص�����
265 client->add_timeout_callback(callback);
266
267 // ���޶�����������󳤶�ʱ
268 if (__max > 0) {
269 client->set_buf_max(__max);
270 }
271
272 // ���첽����һ������
273 client->gets(__timeout, false);
274 return true;
275 }
276};
277
278class mytimer : public acl::aio_timer_callback {

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
getsMethod · 0.80

Tested by

no test coverage detected