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

Function main

example/cpp20/coroutines/echo_server_with_deferred.cpp:55–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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