limit max number of resends

This commit is contained in:
orignal 2014-08-11 19:32:07 -04:00
parent 2f8274a7b3
commit 921ba9a9d6
2 changed files with 15 additions and 3 deletions

View file

@ -37,13 +37,15 @@ namespace stream
const size_t MAX_PACKET_SIZE = 4096;
const size_t COMPRESSION_THRESHOLD_SIZE = 66;
const int RESEND_TIMEOUT = 10; // in seconds
const int MAX_NUM_RESEND_ATTEMPTS = 5;
struct Packet
{
uint8_t buf[MAX_PACKET_SIZE];
size_t len, offset;
Packet (): len (0), offset (0) {};
int numResendAttempts;
Packet (): len (0), offset (0), numResendAttempts (0) {};
uint8_t * GetBuffer () { return buf + offset; };
size_t GetLength () const { return len - offset; };