Pipe Reader Thread: Process Client
| 100 | |
| 101 | // Pipe Reader Thread: Process Client |
| 102 | void 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 |
no test coverage detected