From 79f43a4b8cc8130128e69d2a263736f71b7110e7 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 13 Mar 2025 17:27:39 +0900 Subject: [PATCH] Minor fix, TODO comment Recent changes caused a packet timeout to be either 1 second or double the heartbeat interval time (the maximum of the two). This is kind of a problem since packet timeout should be ideally decided based on the peer's heartbeat interval time, not this instance's heartbeat interval time. Some "scaffolding" code should be added: - Heartbeat packets should send the current instance's heartbeat interval time. - Max capacity of cached sent packets should be increased based on the peer's heartbeat interval and the rate of received non-heartbeat packets. - Maybe have a function to tell UDPC the intended usage regarding latency: focus on low-latency default behavior, or focus on high latency low packet-send-rate behavior. The current changes should be reverted on master and the new changes should be held back for now until this is all set up. --- src/UDPConnection.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/UDPConnection.cpp b/src/UDPConnection.cpp index 06f6286..b962271 100644 --- a/src/UDPConnection.cpp +++ b/src/UDPConnection.cpp @@ -361,11 +361,12 @@ void UDPC::Context::update_impl() { event.conId.port, #ifdef UDPC_LIBSODIUM_ENABLED flags.test(2) && event.v.enableLibSodium != 0, - sk, pk); + sk, pk #else false, - sk, pk); + sk, pk #endif + ); if(newCon.flags.test(5)) { UDPC_CHECK_LOG(this, UDPC_LoggingType::UDPC_ERROR, @@ -1759,6 +1760,8 @@ void UDPC::Context::update_impl() { } // calculate sequence and ack + // TODO: Request tracked packets dropped off the current ack to be sent + // again. bool isOutOfOrder = false; uint32_t diff = 0; if(seqID > iter->second.rseq) { -- 2.49.0