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

Function main

example/cpp17/coroutines_ts/range_based_for.cpp:84–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84int main()
85{
86 try
87 {
88 boost::asio::io_context io_context(1);
89
90 boost::asio::signal_set signals(io_context, SIGINT, SIGTERM);
91 signals.async_wait([&](auto, auto){ io_context.stop(); });
92
93 tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
94 co_spawn(io_context, listener(std::move(acceptor)), detached);
95
96 io_context.run();
97 }
98 catch (std::exception& e)
99 {
100 std::printf("Exception: %s\n", e.what());
101 }
102}

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