MCPcopy Create free account
hub / github.com/caozhiyi/CppNet / _PackageAndSend

Method _PackageAndSend

test/rpc/RPCServer.cpp:122–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void CRPCServer::_PackageAndSend(const cppnet::Handle& handle, FuncCallInfo* info, int code) {
123 if (!info) {
124 base::LOG_ERROR("function info is null!");
125 return;
126 }
127 bool send = true;
128 int get_len = 65535;
129 int need_len = 0;
130 char send_buf[65535] = { 0 };
131 need_len = get_len;
132 if (!_parse_package->PackageFuncRet(send_buf, need_len, code, info->_func_name, _func_map, info->_func_param_ret)) {
133 base::LOG_ERROR("package function response failed!");
134 send = false;
135 }
136 if (send) {
137 handle->Write(send_buf, need_len);
138 }
139}

Callers

nothing calls this directly

Calls 2

PackageFuncRetMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected