aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-02-27 16:47:49 +0100
committerMauro Sardara <msardara@cisco.com>2020-02-27 16:53:55 +0100
commit443f9e81c2f721898c1e7edf2940172fef6f55fe (patch)
tree5d12420e99676f690bd658f64f094840870da2db /utils/src
parentbd8380012c308a79861e2e52919e9ff6326d45dc (diff)
[HICN-539] Expose portal APIs to applications
Change-Id: Icbaad69981193119714f5689faf3518d2e152e11 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'utils/src')
-rw-r--r--utils/src/ping_client.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/utils/src/ping_client.cc b/utils/src/ping_client.cc
index 6dea17418..67440cdc1 100644
--- a/utils/src/ping_client.cc
+++ b/utils/src/ping_client.cc
@@ -14,9 +14,9 @@
*/
#include <hicn/transport/core/interest.h>
+#include <hicn/transport/interfaces/portal.h>
#include <hicn/transport/security/verifier.h>
-
-#include <implementation/socket_consumer.h>
+#include <hicn/transport/utils/log.h>
// Let's make the linker happy
#if !TRANSPORT_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL
@@ -25,6 +25,7 @@ TRANSPORT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = 0;
#endif
#endif
+#include <asio/signal_set.hpp>
#include <asio/steady_timer.hpp>
#include <chrono>
#include <map>
@@ -83,7 +84,7 @@ class Configuration {
}
};
-class Client : implementation::BasePortal::ConsumerCallback {
+class Client : interface::Portal::ConsumerCallback {
public:
Client(Configuration *c)
: portal_(), signals_(portal_.getIoService(), SIGINT) {
@@ -213,6 +214,8 @@ class Client : implementation::BasePortal::ConsumerCallback {
}
}
+ void onError(std::error_code ec) override {}
+
void doPing() {
Name interest_name(config_->name_, (uint32_t)sequence_number_);
hicn_format_t format;
@@ -298,7 +301,7 @@ class Client : implementation::BasePortal::ConsumerCallback {
private:
SendTimeMap send_timestamps_;
- implementation::BasePortal portal_;
+ interface::Portal portal_;
asio::signal_set signals_;
uint64_t sequence_number_;
uint64_t last_jump_;