| 57 | } |
| 58 | |
| 59 | int main(int argc, char *argv[]) { |
| 60 | try { |
| 61 | asio::io_context io_context; |
| 62 | std::thread thd([&io_context] { |
| 63 | asio::io_context::work work(io_context); |
| 64 | io_context.run(); |
| 65 | }); |
| 66 | async_simple::coro::syncAwait(start(io_context, "127.0.0.1", "9980")); |
| 67 | io_context.stop(); |
| 68 | thd.join(); |
| 69 | std::cout << "Finished ok, client quit.\n"; |
| 70 | } catch (std::exception &e) { |
| 71 | std::cerr << "Exception: " << e.what() << "\n"; |
| 72 | } |
| 73 | |
| 74 | return 0; |
| 75 | } |