minor fixes relating to nonce overflows, size checks, etc.

This commit is contained in:
2026-05-25 12:22:33 +02:00
parent b64d9c4498
commit 60795c60d8
5 changed files with 38 additions and 6 deletions

View File

@@ -3,6 +3,8 @@
// Distributed under the terms of the GNU General Public License, either version 2 only or version 3. See LICENSES/ for details.
#include <columnlynx/client/net/udp/udp_client.hpp>
#include <thread>
#include <chrono>
namespace ColumnLynx::Net::UDP {
void UDPClient::start() {
@@ -102,7 +104,12 @@ namespace ColumnLynx::Net::UDP {
if (ec) {
if (ec == asio::error::operation_aborted) return; // Socket closed
// Other recv error
mStartReceive();
Utils::warn("UDPClient receive error: " + ec.message());
// Back off briefly before restarting receive to avoid busy error loops
asio::post(mSocket.get_executor(), [this]() {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
mStartReceive();
});
return;
}