From 6aaef596f68a514036d5212fc8697bdaf371e5af Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 7 Mar 2019 19:11:16 +0100 Subject: [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 --- .../src/hicn/transport/interfaces/socket_consumer.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'libtransport/src/hicn/transport/interfaces/socket_consumer.cc') diff --git a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc index febe66853..ca9722849 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(this); + transport_protocol_ = std::make_unique(this); break; case TransportProtocolAlgorithms::RTC: - transport_protocol_ = std::make_shared(this); + transport_protocol_ = std::make_unique(this); break; case TransportProtocolAlgorithms::RAAQM: default: - transport_protocol_ = std::make_shared(this); + transport_protocol_ = std::make_unique(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() { -- cgit 1.2.3-korg