From fac06d1485609520b6eabae2a5504eba8b91e5ef Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 26 Feb 2018 14:08:59 +0100 Subject: Minor fix for package build, delete pending interest after timeout expiration. Change-Id: I9649bcee4a6daa8dcf2183fcfd903d8806798f52 Signed-off-by: Mauro Sardara --- apps/consumers/icnet_ping_client.cc | 15 ++++++++------- apps/producers/CMakeLists.txt | 2 +- apps/producers/config/iping-server.service | 2 +- icnet/ccnx/icnet_ccnx_portal.cc | 2 ++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/consumers/icnet_ping_client.cc b/apps/consumers/icnet_ping_client.cc index fdc0b405..ac090033 100644 --- a/apps/consumers/icnet_ping_client.cc +++ b/apps/consumers/icnet_ping_client.cc @@ -37,12 +37,12 @@ class Configuration { std::string name_; uint8_t ttl_; - Configuration() { - interestLifetime_ = 500; //ms - pingInterval_ = 1000000; //us - maxPing_ = std::numeric_limits::max(); //number of interests - name_ = "ccnx:/pingserver"; //string - ttl_ = 64; + Configuration() + : interestLifetime_(500), //ms + pingInterval_(1000000), //us + maxPing_(std::numeric_limits::max()), //number of interests + name_("ccnx:/pingserver"), //string + ttl_(64) { } }; @@ -174,6 +174,7 @@ class Client { << "/"; std::cout << std::fixed << std::setprecision(3) << rtt_mdev / 1000 << " ms"; + std::cout << std::endl; } portal_.stopEventsLoop(); @@ -204,7 +205,7 @@ class Client { void help(char * program_name) { std::cout << "usage: " << program_name << " [options]" << " icn-name" << std::endl; std::cout << "PING options" << std::endl; - std::cout << "-i ping interval in microseconds (default 1000 ms)" << std::endl; + std::cout << "-i ping interval in microseconds (default 10^6 us)" << std::endl; std::cout << "-m maximum number of pings to send (default unlimited)" << std::endl; std::cout << "-t set packet ttl (default 64)" << std::endl; //std::cout << "-j jump sequence numbers every interests (default disabled)" << std::endl; diff --git a/apps/producers/CMakeLists.txt b/apps/producers/CMakeLists.txt index 29d71010..15a7a4f8 100755 --- a/apps/producers/CMakeLists.txt +++ b/apps/producers/CMakeLists.txt @@ -40,5 +40,5 @@ install(TARGETS producer-hello-world DESTINATION ${CMAKE_INSTALL_PREFIX}/bin COM install(TARGETS iping-server DESTINATION ${CMAKE_INSTALL_PREFIX}/bin COMPONENT library) if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - install(FILES ${PRODUCER_PING_SERVER_SERVICE_FILE} DESTINATION /lib/systemd/system) + install(FILES ${PRODUCER_PING_SERVER_SERVICE_FILE} DESTINATION /lib/systemd/system COMPONENT library) endif() diff --git a/apps/producers/config/iping-server.service b/apps/producers/config/iping-server.service index 1c5d12f9..d8ca0a9c 100644 --- a/apps/producers/config/iping-server.service +++ b/apps/producers/config/iping-server.service @@ -18,7 +18,7 @@ After=metis-forwarder.service [Service] Environment=SIZE=64 -Environment-NAME=ccnx:/$(hostname)-pingserver +Environment-NAME=ccnx:/$(hostname)/pingserver # This will overrride the default environment EnvironmentFile=-/etc/default/ccnx/iping.conf ExecStart=/bin/bash -c "/usr/bin/iping-server -s ${SIZE} ${NAME}" diff --git a/icnet/ccnx/icnet_ccnx_portal.cc b/icnet/ccnx/icnet_ccnx_portal.cc index 33e8c82f..c13a2e58 100644 --- a/icnet/ccnx/icnet_ccnx_portal.cc +++ b/icnet/ccnx/icnet_ccnx_portal.cc @@ -73,6 +73,8 @@ void Portal::sendInterest(const Interest &interest, it->second->getOnTimeoutCallback()(*it->second->getInterest()); } } + + pending_interest_hash_table_.erase(name); }; pend_interest->startCountdown(timer_callback); -- cgit 1.2.3-korg