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

Function main

example/cpp20/coroutines/echo_server.cpp:59–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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