aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/hiperf.cc
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-10-15 18:08:41 +0200
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-10-22 11:01:41 +0200
commit755c6833ae2d2eee87e80ed3b84c75e968f48c46 (patch)
tree653345beb889acabc83b3b3b03e849fa34b1baac /utils/src/hiperf.cc
parent7204bac00804448a797d4e76ced04a3b84d0d741 (diff)
[HICN-328] Reworking setSocketOption and getSocketOption to be thread-safe
Change-Id: Ie22572822b9ac1e6c300fd7982035c799546bd76 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'utils/src/hiperf.cc')
-rw-r--r--utils/src/hiperf.cc17
1 files changed, 8 insertions, 9 deletions
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<ConsumerSocket>(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<transport::BasePortal> 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': {