| 65 | } |
| 66 | |
| 67 | int main(int argc, char* argv[]) |
| 68 | { |
| 69 | try |
| 70 | { |
| 71 | if (argc != 2) |
| 72 | { |
| 73 | std::cerr << "Usage: daytime_client <host>" << std::endl; |
| 74 | return 1; |
| 75 | } |
| 76 | |
| 77 | // We run the io_context off in its own thread so that it operates |
| 78 | // completely asynchronously with respect to the rest of the program. |
| 79 | boost::asio::io_context io_context; |
| 80 | auto work = boost::asio::make_work_guard(io_context); |
| 81 | std::thread thread([&io_context](){ io_context.run(); }); |
| 82 | |
| 83 | get_daytime(io_context, argv[1]); |
| 84 | |
| 85 | io_context.stop(); |
| 86 | thread.join(); |
| 87 | } |
| 88 | catch (std::exception& e) |
| 89 | { |
| 90 | std::cerr << e.what() << std::endl; |
| 91 | } |
| 92 | |
| 93 | return 0; |
| 94 | } |
nothing calls this directly
no test coverage detected