Skip to content

Commit

Permalink
Clang compiler bug workaround
Browse files Browse the repository at this point in the history
Before, message became empty on the second iteration of the loop
  • Loading branch information
gottagofaster236 committed Jun 24, 2024
1 parent 4d498ed commit 6d7f26c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PubsubListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ asio::awaitable<void> PubsubListener::asyncSubscribeToChannelPoints(WebsocketStr
}

asio::awaitable<void> 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) {
Expand Down

0 comments on commit 6d7f26c

Please sign in to comment.