MCPcopy Create free account
hub / github.com/ARM-software/armnn / ReadFromSocket

Method ReadFromSocket

profiling/server/src/basePipeServer/BasePipeServer.cpp:22–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{
21
22bool BasePipeServer::ReadFromSocket(uint8_t* packetData, uint32_t expectedLength)
23{
24 // This is a blocking read until either expectedLength has been received or an error is detected.
25 long totalBytesRead = 0;
26 while (arm::pipe::numeric_cast<uint32_t>(totalBytesRead) < expectedLength)
27 {
28 long bytesRead = arm::pipe::Read(m_ClientConnection, packetData, expectedLength);
29 if (bytesRead < 0)
30 {
31 std::cerr << ": Failure when reading from client socket: " << strerror(errno) << std::endl;
32 return false;
33 }
34 if (bytesRead == 0)
35 {
36 std::cerr << ": EOF while reading from client socket." << std::endl;
37 return false;
38 }
39 totalBytesRead += bytesRead;
40 }
41 return true;
42};
43
44bool BasePipeServer::WaitForStreamMetaData()
45{

Callers

nothing calls this directly

Calls 1

ReadFunction · 0.85

Tested by

no test coverage detected