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

Function main

example/cpp11/echo/async_udp_echo_server.cpp:60–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60int main(int argc, char* argv[])
61{
62 try
63 {
64 if (argc != 2)
65 {
66 std::cerr << "Usage: async_udp_echo_server <port>\n";
67 return 1;
68 }
69
70 boost::asio::io_context io_context;
71 auto work = boost::asio::make_work_guard(io_context);
72 std::thread t([&](){io_context.run();});
73
74 server s(io_context, std::atoi(argv[1]));
75
76 work.reset();
77 t.join();
78 }
79 catch (std::exception& e)
80 {
81 std::cerr << "Exception: " << e.what() << "\n";
82 }
83
84 return 0;
85}

Callers

nothing calls this directly

Calls 3

runMethod · 0.45
resetMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected