implement dynamic timeout

This commit is contained in:
2023-03-12 01:24:11 +01:00
parent dfeb569aee
commit 95bfa2473c
4 changed files with 44 additions and 49 deletions

View File

@ -29,17 +29,17 @@ struct LEDBAT {
static_assert(maximum_segment_size == 574); // mesured in wireshark
// ledbat++ says 60ms, we might need other values if relayed
const float target_delay {0.060f};
//const float target_delay {0.030f};
//const float target_delay {0.060f};
const float target_delay {0.030f};
//const float target_delay {0.120f}; // 2x if relayed?
// TODO: use a factor for multiple of rtt
static constexpr size_t current_delay_filter_window {16*4*2};
static constexpr size_t current_delay_filter_window {16*4};
//static constexpr size_t rtt_buffer_size_max {2000};
float max_byterate_allowed {10*1024*1024}; // 10MiB/s
//float max_byterate_allowed {2*1024*1024};
//float max_byterate_allowed {10*1024*1024}; // 10MiB/s
float max_byterate_allowed {1*1024*1024};
public:
LEDBAT(void);
@ -55,6 +55,9 @@ struct LEDBAT {
// respect max_byterate_allowed
size_t canSend(void) const;
// get the list of timed out seq_ids
std::vector<SeqIDType> getTimeouts(void) const;
public: // callbacks
// data size is without overhead
void onSent(SeqIDType seq, size_t data_size);