MCPcopy Create free account
hub / github.com/boostorg/asio / main

Function main

example/cpp20/coroutines/echo_server_with_deferred_default.cpp:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54int main()
55{
56 try
57 {
58 boost::asio::io_context io_context(1);
59
60 boost::asio::signal_set signals(io_context, SIGINT, SIGTERM);
61 signals.async_wait([&](auto, auto){ io_context.stop(); });
62
63 co_spawn(io_context, listener(), detached);
64
65 io_context.run();
66 }
67 catch (std::exception& e)
68 {
69 std::printf("Exception: %s\n", e.what());
70 }
71}

Callers

nothing calls this directly

Calls 5

listenerFunction · 0.70
co_spawnFunction · 0.50
async_waitMethod · 0.45
stopMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected