MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / readMessage

Method readMessage

framework/communication/messageServer.cpp:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 return mClient->connect(server);
62}
63std::string messageClient::readMessage()
64{
65 uint32_t size = 0;
66 mClient->read_u32(&size);
67 mBuffer[size] = 0;
68 auto *p = reinterpret_cast<uint8_t *>(mBuffer);
69 while (size > 0) {
70 int ret = mClient->read(p, size);
71 if (ret > 0) {
72 p += ret;
73 size -= ret;
74 } else {
75 break;
76 }
77 }
78 return mBuffer;
79}

Callers 2

testMessageFunction · 0.80
process_client_msgFunction · 0.80

Calls 2

read_u32Method · 0.80
readMethod · 0.45

Tested by 1

testMessageFunction · 0.64