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

Method on_accept

lib_acl_cpp/samples/master/master_http_rpc/master_service.cpp:46–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46bool master_service::on_accept(acl::aio_socket_stream* client)
47{
48 // ������������߳���Ԥ��������������Ԥ����־λ
49 if (var_cfg_preread)
50 {
51 ACL_VSTREAM* vstream = client->get_vstream();
52 vstream->flag |= ACL_VSTREAM_FLAG_PREREAD;
53 }
54
55 // �����첽�ͻ������Ļص���������첽�����а�
56 http_client* callback = new http_client(client);
57
58 // ע���첽���Ķ��ص�����
59 client->add_read_callback(callback);
60
61 // ע���첽����д�ص�����
62 client->add_write_callback(callback);
63
64 // ע���첽���Ĺرջص�����
65 client->add_close_callback(callback);
66
67 // ע���첽���ij�ʱ�ص�����
68 client->add_timeout_callback(callback);
69
70 rpc_read_wait_add();
71
72 // ����첽���Ƿ�ɶ�
73 client->read_wait(0);
74
75 return true;
76}
77
78void master_service::proc_on_init()
79{

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