From da6d752b55d386e6814b63214f4b2639c29ab3ae Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 27 Aug 2019 13:06:15 +0900 Subject: [PATCH] Set max size for received pkts queue --- cpp_impl/src/UDPC_Defines.hpp | 1 + cpp_impl/src/UDPConnection.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp_impl/src/UDPC_Defines.hpp b/cpp_impl/src/UDPC_Defines.hpp index 52ffb44..2950d11 100644 --- a/cpp_impl/src/UDPC_Defines.hpp +++ b/cpp_impl/src/UDPC_Defines.hpp @@ -7,6 +7,7 @@ #define UDPC_BAD_MODE_SEND_INTERVAL (1.0f / 10.0f) #define UDPC_SENT_PKTS_MAX_SIZE 33 #define UDPC_QUEUED_PKTS_MAX_SIZE 32 +#define UDPC_RECEIVED_PKTS_MAX_SIZE 50 #define UDPC_GOOD_RTT_LIMIT_SEC 0.25f #define UDPC_PACKET_TIMEOUT_SEC 1.0f diff --git a/cpp_impl/src/UDPConnection.cpp b/cpp_impl/src/UDPConnection.cpp index dddd708..d7f8590 100644 --- a/cpp_impl/src/UDPConnection.cpp +++ b/cpp_impl/src/UDPConnection.cpp @@ -21,17 +21,18 @@ toggledTimer(0.0f), sentPkts(), sendPkts(UDPC_QUEUED_PKTS_MAX_SIZE), priorityPkts(UDPC_QUEUED_PKTS_MAX_SIZE), +receivedPkts(UDPC_RECEIVED_PKTS_MAX_SIZE), received(std::chrono::steady_clock::now()), sent(std::chrono::steady_clock::now()), rtt(0.0f) { + flags.set(0); } UDPC::ConnectionData::ConnectionData(bool isServer, Context *ctx) : UDPC::ConnectionData::ConnectionData() { if(isServer) { - flags.set(0); flags.set(3); id = UDPC::generateConnectionID(*ctx); flags.set(4);