diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-10-08 14:00:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-10-08 14:00:20 +0000 |
commit | 4802315ae6800dd9c433296f9012373244df19e5 (patch) | |
tree | d73e085453a6182f84bd906fab605a993a236f6c /libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h | |
parent | bc057491691b84c877e276f611a818b2455f67f1 (diff) | |
parent | e8e399a5fd74ff35f703364c876e01679f0606b7 (diff) |
Merge "[HICN-302] low rate traffic in RTC"
Diffstat (limited to 'libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h')
-rw-r--r-- | libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h | 18 |
1 files changed, 17 insertions, 1 deletions
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<uint64_t,uint32_t> timers_map_; + // this map does the opposite, this map is not ordered + std::unordered_map<uint32_t,uint64_t> seqs_map_; + bool timer_on_; + std::unique_ptr<asio::steady_timer> interests_cache_timer_; + utils::SpinLock interests_cache_lock_; + uint64_t lastProduced_; bool active_; utils::SpinLock lock_; |