MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / Read

Method Read

src/jsonrpccpp/common/streamreader.cpp:13–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11StreamReader::~StreamReader() { free(buffer); }
12
13bool StreamReader::Read(std::string &target, int fd, char delimiter) {
14 ssize_t bytesRead;
15 do {
16 bytesRead = read(fd, this->buffer, buffersize);
17 if (bytesRead < 0) {
18 return false;
19 } else {
20 target.append(buffer, static_cast<size_t>(bytesRead));
21 }
22 } while (memchr(buffer, delimiter, bytesRead) == NULL); //(target.find(delimiter) == string::npos && bytesRead > 0);
23
24 target.pop_back();
25 return true;
26}

Callers 8

SendRPCMessageMethod · 0.80
SendRPCMessageMethod · 0.80
SendRPCMessageMethod · 0.80
SendRPCMessageMethod · 0.80
HandleConnectionMethod · 0.80
HandleConnectionMethod · 0.80
HandleConnectionMethod · 0.80
HandleConnectionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected