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

Function OnMessage

test/pingpong/Server.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void OnMessage(const Handle& handle, base::CBuffer* data, uint32_t, uint32_t error) {
37 char buff[65535];
38 if (error == CEC_SUCCESS) {
39 while (data->GetCanReadLength()) {
40 int ret = data->Read(buff, 65535);
41 handle->Write(buff, ret);
42 }
43
44 } else {
45 std::cout << " something error while reading. err : " << error << std::endl;
46 }
47}
48
49int main() {
50 cppnet::CCppNet net;

Callers

nothing calls this directly

Calls 3

GetCanReadLengthMethod · 0.45
ReadMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected