diff options
Diffstat (limited to 'libtransport/src/hicn/transport/interfaces')
3 files changed, 6 insertions, 7 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc index 27ed4e65f..89411e92c 100644 --- a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc +++ b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc @@ -99,7 +99,7 @@ int ConsumerSocket::consume(const Name &name, transport_protocol_->start(receive_buffer); - return CONSUMER_READY; + return CONSUMER_FINISHED; } int ConsumerSocket::asyncConsume( @@ -115,7 +115,7 @@ int ConsumerSocket::asyncConsume( }); } - return CONSUMER_READY; + return CONSUMER_RUNNING; } void ConsumerSocket::asyncSendInterest(Interest::Ptr &&interest, diff --git a/libtransport/src/hicn/transport/interfaces/socket_consumer.h b/libtransport/src/hicn/transport/interfaces/socket_consumer.h index 9e309aae8..536d2fde3 100755 --- a/libtransport/src/hicn/transport/interfaces/socket_consumer.h +++ b/libtransport/src/hicn/transport/interfaces/socket_consumer.h @@ -26,8 +26,9 @@ #include <hicn/transport/utils/event_thread.h> #include <hicn/transport/utils/sharable_vector.h> -#define CONSUMER_READY 0 +#define CONSUMER_FINISHED 0 #define CONSUMER_BUSY 1 +#define CONSUMER_RUNNING 2 namespace transport { diff --git a/libtransport/src/hicn/transport/interfaces/socket_producer.cc b/libtransport/src/hicn/transport/interfaces/socket_producer.cc index 69adc2b3f..d9204f111 100755 --- a/libtransport/src/hicn/transport/interfaces/socket_producer.cc +++ b/libtransport/src/hicn/transport/interfaces/socket_producer.cc @@ -54,9 +54,9 @@ ProducerSocket::ProducerSocket(asio::io_service &io_service) } ProducerSocket::~ProducerSocket() { - TRANSPORT_LOGI("Destroying the ProducerSocket"); + processing_thread_stop_ = true; - portal_->stopEventsLoop(); + portal_->stopEventsLoop(true); if (processing_thread_.joinable()) { processing_thread_.join(); @@ -79,8 +79,6 @@ void ProducerSocket::serveForever() { } void ProducerSocket::stop() { - TRANSPORT_LOGI("Calling stop for ProducerSocket"); - portal_->killConnection(); portal_->stopEventsLoop(); } |