MCPcopy Create free account
hub / github.com/dobin/RedEdr / PplReaderClient

Function PplReaderClient

RedEdr/pplreader.cpp:102–128  ·  view source on GitHub ↗

Pipe Reader Thread: Process Client

Source from the content-addressed store, hash-verified

100
101// Pipe Reader Thread: Process Client
102void PplReaderClient(PipeServer* pipeServer) {
103 if (pipeServer == nullptr) {
104 LOG_A(LOG_ERROR, "PplReader: pipeServer is null");
105 return;
106 }
107 LOG_A(LOG_INFO, "PplReader: RedEdrPplService connected successful, starting event reception");
108
109 while (WaitForSingleObject(hStopEventPpl, 0) != WAIT_OBJECT_0) {
110 try {
111 std::vector<std::string> results = pipeServer->ReceiveBatch();
112 if (results.empty()) {
113 LOG_A(LOG_INFO, "PplReader: PPL service disconnected");
114 break; // Client disconnected or error
115 }
116 for (const auto& result : results) {
117 if (!result.empty()) {
118 //LOG_A(LOG_DEBUG, "PplReader: Received PPL event: %s", result.c_str());
119 g_EventAggregator.NewEvent(result);
120 }
121 }
122 }
123 catch (...) {
124 LOG_A(LOG_ERROR, "PplReader: Exception in receive loop");
125 break;
126 }
127 }
128}
129
130
131// Shutdown

Callers 1

PplReaderThreadFunction · 0.85

Calls 4

ReceiveBatchMethod · 0.80
emptyMethod · 0.80
NewEventMethod · 0.80
LOG_AFunction · 0.70

Tested by

no test coverage detected