aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn/transport/interfaces/socket_consumer.cc
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-03-07 19:11:16 +0100
committerMauro Sardara <msardara@cisco.com>2019-03-08 13:32:22 +0100
commit6aaef596f68a514036d5212fc8697bdaf371e5af (patch)
treed09237bb6810c4aa5eff1a3033633e46bb44e3f6 /libtransport/src/hicn/transport/interfaces/socket_consumer.cc
parent3c6c43ef7bc7caa03540b2347e7f180d5b96ec23 (diff)
[HICN-99] Destroy in the correct order and in the correct event loop the attributes of connectors and sockets. Cleanup of prints.
Change-Id: Ie7eef1d186e581aa950f47df20d57681dc33be55 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/interfaces/socket_consumer.cc')
-rw-r--r--libtransport/src/hicn/transport/interfaces/socket_consumer.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc
index febe668..ca97228 100644
--- a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc
+++ b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc
@@ -62,25 +62,21 @@ ConsumerSocket::ConsumerSocket(int protocol, asio::io_service &io_service)
timer_interval_milliseconds_(0) {
switch (protocol) {
case TransportProtocolAlgorithms::CBR:
- transport_protocol_ = std::make_shared<CbrTransportProtocol>(this);
+ transport_protocol_ = std::make_unique<CbrTransportProtocol>(this);
break;
case TransportProtocolAlgorithms::RTC:
- transport_protocol_ = std::make_shared<RTCTransportProtocol>(this);
+ transport_protocol_ = std::make_unique<RTCTransportProtocol>(this);
break;
case TransportProtocolAlgorithms::RAAQM:
default:
- transport_protocol_ = std::make_shared<RaaqmTransportProtocol>(this);
+ transport_protocol_ = std::make_unique<RaaqmTransportProtocol>(this);
break;
}
}
ConsumerSocket::~ConsumerSocket() {
stop();
-
async_downloader_.stop();
-
- transport_protocol_.reset();
- portal_.reset();
}
void ConsumerSocket::connect() { portal_->connect(); }
@@ -132,10 +128,9 @@ void ConsumerSocket::asyncSendInterest(Interest::Ptr &&interest,
void ConsumerSocket::stop() {
if (transport_protocol_->isRunning()) {
+ std::cout << "Stopping transport protocol " << std::endl;
transport_protocol_->stop();
}
-
- // is_running_ = false;
}
void ConsumerSocket::resume() {