MCPcopy Create free account
hub / github.com/COVESA/vsomeip / async_read

Method async_read

test/common/src/external/process_win.cpp:228–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void Process::async_read() noexcept {
229 if (data.id == 0)
230 return;
231
232 if (stdout_fd) {
233 stdout_thread = std::thread([this]() {
234 DWORD n;
235 std::unique_ptr<char[]> buffer(new char[config.buffer_size]);
236 for (;;) {
237 BOOL bSuccess = ReadFile(*stdout_fd, static_cast<CHAR*>(buffer.get()), static_cast<DWORD>(config.buffer_size), &n, nullptr);
238 if (!bSuccess || n == 0) {
239 if (config.on_stdout_close)
240 config.on_stdout_close();
241 break;
242 }
243 read_stdout(buffer.get(), static_cast<size_t>(n));
244 }
245 });
246 }
247 if (stderr_fd) {
248 stderr_thread = std::thread([this]() {
249 DWORD n;
250 std::unique_ptr<char[]> buffer(new char[config.buffer_size]);
251 for (;;) {
252 BOOL bSuccess = ReadFile(*stderr_fd, static_cast<CHAR*>(buffer.get()), static_cast<DWORD>(config.buffer_size), &n, nullptr);
253 if (!bSuccess || n == 0) {
254 if (config.on_stderr_close)
255 config.on_stderr_close();
256 break;
257 }
258 read_stderr(buffer.get(), static_cast<size_t>(n));
259 }
260 });
261 }
262}
263
264int Process::get_exit_status() noexcept {
265 if (data.id == 0)

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected