MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / wait_for_client

Method wait_for_client

src/oidbridge/oid_bridge.cpp:343–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341 }
342
343 void wait_for_client() {
344 if (client_ == nullptr) {
345 try {
346 client_ = std::make_unique<oid::AsioTransport>(
347 acceptor_.accept(std::chrono::seconds{10}));
348 } catch (const std::runtime_error&) {
349 // oid::SocketTimeoutError (accept timed out). Caught as the
350 // base std::runtime_error: it is thrown from liboidipc and
351 // this catch is in liboidbridge (-fvisibility=hidden), so a
352 // derived-type catch would miss it across the shared-library
353 // boundary and std::terminate.
354 std::cerr << "[OpenImageDebugger] No clients connected to "
355 "OpenImageDebugger server"
356 << std::endl;
357 }
358 }
359 }
360};
361
362// C++ implementation that accepts std::function (avoids function pointer in

Callers

nothing calls this directly

Calls 1

acceptMethod · 0.80

Tested by

no test coverage detected