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

Function run_until

src/ipc/asio_transport.cpp:41–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39// of its own until the accept completes).
40template <typename Cancellable>
41bool run_until(asio::io_context& ctx,
42 Cancellable& cancellable,
43 const bool& done,
44 std::chrono::milliseconds timeout) {
45 ctx.restart();
46 ctx.run_for(timeout);
47 if (!done) { // deadline hit before the op completed
48 asio::error_code ignore;
49 cancellable.cancel(ignore);
50 ctx.run(); // let the cancelled handler run so its captures are safe to
51 // destroy
52 return true; // timed out
53 }
54 return false;
55}
56} // namespace
57
58AsioTransport::AsioTransport(const std::string& host,

Callers 3

AsioTransportMethod · 0.85
receiveMethod · 0.85
acceptMethod · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected