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

Function ReadFunc

test/echo/EchoServer.cpp:21–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void ReadFunc(const Handle& handle, base::CBuffer* data, uint32_t len, uint32_t error) {
22 if (error != CEC_SUCCESS) {
23 std::cout << "something err while read : " << error << std::endl;
24
25 } else {
26 char msg_buf[__buf_len] = {0};
27 int need_len = 0;
28 int find_len = strlen(__buf_spilt);
29 // get recv data to send back.
30 int size = data->ReadUntil(msg_buf, __buf_len, __buf_spilt, find_len, need_len);
31 handle->Write(msg_buf, size);
32 }
33}
34
35void ConnectFunc(const Handle& handle, uint32_t error) {
36 if (error != CEC_SUCCESS) {

Callers

nothing calls this directly

Calls 2

ReadUntilMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected