summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/cmake/Modules/Packaging.cmake4
-rwxr-xr-xutils/src/ping_client.cc15
2 files changed, 12 insertions, 7 deletions
diff --git a/utils/cmake/Modules/Packaging.cmake b/utils/cmake/Modules/Packaging.cmake
index cff3d3fb1..37c123cf2 100644
--- a/utils/cmake/Modules/Packaging.cmake
+++ b/utils/cmake/Modules/Packaging.cmake
@@ -18,11 +18,11 @@ useful for testing and debugging within a hicn network."
)
set(${HICN_UTILS}_DEB_DEPENDENCIES
- "libhicntransport (>= 1.0)"
+ "libhicntransport (>= stable_version)"
CACHE STRING "Dependencies for deb/rpm package."
)
set(${HICN_UTILS}_RPM_DEPENDENCIES
- "libhicntransport >= 1.0"
+ "libhicntransport >= stable_version"
CACHE STRING "Dependencies for deb/rpm package."
) \ No newline at end of file
diff --git a/utils/src/ping_client.cc b/utils/src/ping_client.cc
index c3bfa4086..24f7bd7c9 100755
--- a/utils/src/ping_client.cc
+++ b/utils/src/ping_client.cc
@@ -76,13 +76,15 @@ class Configuration {
class Client : interface::BasePortal::ConsumerCallback {
public:
- Client(Configuration *c) : portal_() {
+ Client(Configuration *c)
+ : portal_(),
+ signals_(portal_.getIoService(), SIGINT, SIGQUIT) {
// Let the main thread to catch SIGINT and SIGQUIT
- // asio::signal_set signals(io_service, SIGINT, SIGQUIT);
- // signals.async_wait(std::bind(&Client::afterSignal, this));
-
portal_.connect();
portal_.setConsumerCallback(this);
+
+ signals_.async_wait(std::bind(&Client::afterSignal, this));
+
timer_.reset(new asio::steady_timer(portal_.getIoService()));
config_ = c;
sequence_number_ = config_->first_suffix_;
@@ -97,6 +99,8 @@ class Client : interface::BasePortal::ConsumerCallback {
}
}
+ virtual ~Client() {}
+
void ping() {
std::cout << "start ping" << std::endl;
doPing();
@@ -270,7 +274,7 @@ class Client : interface::BasePortal::ConsumerCallback {
std::cout << "Stop ping" << std::endl;
std::cout << "Sent: " << sent_ << " Received: " << received_
<< " Timeouts: " << timedout_ << std::endl;
- portal_.stopEventsLoop();
+ portal_.stopEventsLoop(true);
}
void reset() {
@@ -287,6 +291,7 @@ class Client : interface::BasePortal::ConsumerCallback {
private:
SendTimeMap send_timestamps_;
interface::BasePortal portal_;
+ asio::signal_set signals_;
uint64_t sequence_number_;
uint64_t last_jump_;
uint64_t processed_;