Set max size for received pkts queue

This commit is contained in:
Stephen Seo 2019-08-27 13:06:15 +09:00
parent 236b03c9b1
commit da6d752b55
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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);