From 6d7f26cd03a385ea7dcccb9a4d660d288aff6ac2 Mon Sep 17 00:00:00 2001 From: Lev Leontev Date: Mon, 24 Jun 2024 02:30:15 +0200 Subject: [PATCH] Clang compiler bug workaround Before, message became empty on the second iteration of the loop --- src/PubsubListener.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PubsubListener.cpp b/src/PubsubListener.cpp index c540ad7..1e24302 100644 --- a/src/PubsubListener.cpp +++ b/src/PubsubListener.cpp @@ -116,9 +116,9 @@ asio::awaitable PubsubListener::asyncSubscribeToChannelPoints(WebsocketStr } asio::awaitable PubsubListener::asyncSendPingMessages(WebsocketStream& ws) { + json::value message{{"type", "PING"}}; while (true) { auto sentPingAt = std::chrono::steady_clock::now(); - json::value message{{"type", "PING"}}; co_await asyncSendMessage(ws, message); co_await asio::steady_timer(pubsubThread.ioContext, PING_PERIOD).async_wait(asio::use_awaitable); if (lastPongReceivedAt < sentPingAt) {