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

Method rpc_run

lib_acl_cpp/samples/http_server/http_rpc.cpp:46–71  ·  view source on GitHub ↗

���� service_.rpc_fork ���� RPC ��������߳��е��ñ����� ��������������ģ�鷢����������Ϣ

Source from the content-addressed store, hash-verified

44// ���� service_.rpc_fork ���� RPC ��������߳��е��ñ�����
45// ��������������ģ�鷢����������Ϣ
46void http_rpc::rpc_run()
47{
48 // ������������
49 socket_stream stream;
50
51 // ������ get_vstream() ��õ� ACL_VSTREAM ������������
52 // ���� stream ������Ϊ�� acl_cpp �� acl �е�������
53 // �ͷ����������ն��ǻ��� ACL_VSTREAM���� ACL_VSTREAM ��
54 // �ڲ�ά������һ����/д�������������ڳ����ӵ����ݴ����У�
55 // ����ÿ�ν� ACL_VSTREAM ��Ϊ�ڲ����Ļ��������Դ�
56 ACL_VSTREAM* vstream = client_->get_vstream();
57 ACL_VSTREAM_SET_RWTIMO(vstream, 10);
58 (void) stream.open(vstream);
59
60 rpc_req_add();
61
62 // ��ʼ������ HTTP ����
63 handle_conn(&stream);
64
65 rpc_req_del();
66
67 // �� ACL_VSTREAM �������������󶨣��������ܱ�֤���ͷ�����������ʱ
68 // ����ر��������ߵ����ӣ���Ϊ�����ӱ��������ڷ�����������ģ���Ҫ��
69 // ���첽���رշ�ʽ���йر�
70 stream.unbind();
71}
72
73void http_rpc::handle_conn(socket_stream* stream)
74{

Callers

nothing calls this directly

Calls 5

rpc_req_addFunction · 0.70
rpc_req_delFunction · 0.70
get_vstreamMethod · 0.45
openMethod · 0.45
unbindMethod · 0.45

Tested by

no test coverage detected