diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-04-16 18:38:07 +0200 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2019-04-18 16:56:04 +0000 |
commit | b375370d0f11163da8cb752c4a3f992a89ef80ee (patch) | |
tree | b34e8d92fb616261209a09b89e3538ea94b4c3c3 /libtransport/src/hicn/transport/interfaces/socket_consumer.cc | |
parent | 564dfea33b993c3ff6572894ef35f91ba37d23ed (diff) |
[HICN-178] Sync send of control messages.v19.04
Change-Id: I9a07c6c806ceba10f80a5f67337dce2eee76120d
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.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc index 37d545779..af99fd60c 100644 --- a/libtransport/src/hicn/transport/interfaces/socket_consumer.cc +++ b/libtransport/src/hicn/transport/interfaces/socket_consumer.cc @@ -123,10 +123,12 @@ void ConsumerSocket::asyncSendInterest(Interest::Ptr &&interest, } void ConsumerSocket::stop() { - if (transport_protocol_->isRunning()) { - std::cout << "Stopping transport protocol " << std::endl; - transport_protocol_->stop(); - } + auto &io_service = getIoService(); + io_service.dispatch([this]() { + if (transport_protocol_->isRunning()) { + transport_protocol_->stop(); + } + }); } void ConsumerSocket::resume() { @@ -141,4 +143,4 @@ asio::io_service &ConsumerSocket::getIoService() { } // namespace interface -} // end namespace transport +} // end namespace transport
\ No newline at end of file |