diff --git a/src/main.cc b/src/main.cc index ab92e6c..44c49ea 100644 --- a/src/main.cc +++ b/src/main.cc @@ -83,11 +83,11 @@ Bot::Bot(asio::any_io_executor executor, std::string_view name, asio::awaitable Bot::Protocol() { asio::ip::tcp::resolver resolver{executor}; asio::ip::tcp::resolver::query query{server, "4000"}; - auto host = co_await resolver.async_resolve(query, asio::use_awaitable); while (true) { while (true) { try { + auto host = co_await resolver.async_resolve(query, asio::use_awaitable); co_await asio::async_connect(socket, host, asio::use_awaitable); break; } catch (std::exception &e) {