From 9f0080e53da7ad68f501ac28b1ff26da8b95ed75 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 20 Nov 2020 20:21:06 +0000 Subject: [HICN-658] Improve memif connector. Signed-off-by: Mauro Sardara Change-Id: Ie3b48148dcb3f782a1ca906a5ba59d605f17f93e Signed-off-by: Mauro Sardara --- utils/src/hiperf.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc index 967241250..f4764e096 100644 --- a/utils/src/hiperf.cc +++ b/utils/src/hiperf.cc @@ -217,7 +217,7 @@ class HIperfClient { : configuration_(conf), total_duration_milliseconds_(0), old_bytes_value_(0), - signals_(io_service_, SIGINT), + signals_(io_service_), expected_seg_(0), lost_packets_(std::unordered_set()), rtc_callback_(configuration_.rtc_ ? new RTCCallback(*this) : nullptr), @@ -514,6 +514,7 @@ class HIperfClient { int run() { std::cout << "Starting download of " << configuration_.name << std::endl; + signals_.add(SIGINT); signals_.async_wait([this](const std::error_code &, const int &) { consumer_socket_->stop(); io_service_.stop(); @@ -712,7 +713,7 @@ class HIperfServer { public: HIperfServer(ServerConfiguration &conf) : configuration_(conf), - signals_(io_service_, SIGINT), + signals_(io_service_), rtc_timer_(io_service_), unsatisfied_interests_(), content_objects_((std::uint16_t)(1 << log2_content_object_buffer_size)), @@ -1023,6 +1024,7 @@ class HIperfServer { int run() { std::cerr << "Starting to serve consumers" << std::endl; + signals_.add(SIGINT); signals_.async_wait([this](const std::error_code &, const int &) { std::cout << "STOPPING!!" << std::endl; producer_socket_->stop(); -- cgit 1.2.3-korg