From e8e399a5fd74ff35f703364c876e01679f0606b7 Mon Sep 17 00:00:00 2001 From: michele papalini Date: Tue, 8 Oct 2019 11:20:25 +0200 Subject: [HICN-302] low rate traffic in RTC Signed-off-by: michele papalini Change-Id: Ib6511d82abc91e9008588cd2b7fd80022c6d232b --- .../hicn/transport/interfaces/rtc_socket_producer.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h') diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h index 5b9a23dd7..aa67f1a29 100644 --- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h +++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h @@ -41,8 +41,10 @@ class RTCProducerSocket : public ProducerSocket { void onInterest(Interest::Ptr &&interest) override; private: - void sendNack(const Interest &interest, bool isActive); + void sendNack(uint32_t sequence, bool isActive); void updateStats(uint32_t packet_size, uint64_t now); + void scheduleTimer(uint64_t wait); + void interestCacheTimer(); uint32_t currentSeg_; uint32_t prodLabel_; @@ -55,6 +57,20 @@ class RTCProducerSocket : public ProducerSocket { uint32_t perSecondFactor_; uint64_t lastStats_; + // cache for the received interests + // this map maps the expiration time of an interest to + // its sequence number. the map is sorted by timeouts + // the same timeout may be used for multiple sequence numbers + // but for each sequence number we store only the smallest + // expiry time. In this way the mapping from seqs_map_ to + // timers_map_ is unique + std::multimap timers_map_; + // this map does the opposite, this map is not ordered + std::unordered_map seqs_map_; + bool timer_on_; + std::unique_ptr interests_cache_timer_; + utils::SpinLock interests_cache_lock_; + uint64_t lastProduced_; bool active_; utils::SpinLock lock_; -- cgit 1.2.3-korg