From 755c6833ae2d2eee87e80ed3b84c75e968f48c46 Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Tue, 15 Oct 2019 18:08:41 +0200 Subject: [HICN-328] Reworking setSocketOption and getSocketOption to be thread-safe Change-Id: Ie22572822b9ac1e6c300fd7982035c799546bd76 Signed-off-by: Alberto Compagno --- utils/src/hiperf.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'utils') diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc index ccb22779b..94e5d998d 100644 --- a/utils/src/hiperf.cc +++ b/utils/src/hiperf.cc @@ -47,7 +47,6 @@ namespace interface { #define MIN_PROBE_SEQ 0xefffffff - using CryptoSuite = utils::CryptoSuite; using Identity = utils::Identity; @@ -217,8 +216,8 @@ class HIperfClient { expected_seg_ = productionSeg; } else if (receivedSeg > productionSeg && receivedSeg < MIN_PROBE_SEQ) { std::cout << "[WINDOW TO LARGE] received NACK for " << receivedSeg - << ". Next expected packet " << productionSeg << std::endl; - } else if (receivedSeg >= MIN_PROBE_SEQ){ + << ". Next expected packet " << productionSeg << std::endl; + } else if (receivedSeg >= MIN_PROBE_SEQ) { std::cout << "[PROBE] probe number = " << receivedSeg << std::endl; } return; @@ -259,9 +258,7 @@ class HIperfClient { void handleTimerExpiration(ConsumerSocket &c, const protocol::TransportStatistics &stats) { - - if (configuration_.rtc_) - return; + if (configuration_.rtc_) return; const char separator = ' '; const int width = 20; @@ -327,7 +324,9 @@ class HIperfClient { } consumer_socket_ = std::make_unique(transport_protocol); - consumer_socket_->setSocketOption(GeneralTransportOptions::INTEREST_LIFETIME, configuration_.interest_lifetime_); + consumer_socket_->setSocketOption( + GeneralTransportOptions::INTEREST_LIFETIME, + configuration_.interest_lifetime_); #if defined(DEBUG) && defined(__linux__) std::shared_ptr portal; @@ -944,8 +943,8 @@ int main(int argc, char *argv[]) { int opt; #ifndef _WIN32 - while ((opt = getopt(argc, argv, "DSCf:b:d:W:RMc:vA:s:rmlk:y:p:hi:xB:ItL:")) != - -1) { + while ((opt = getopt(argc, argv, + "DSCf:b:d:W:RMc:vA:s:rmlk:y:p:hi:xB:ItL:")) != -1) { switch (opt) { // Common case 'D': { -- cgit 1.2.3-korg