From bde02e814e7f68e6ebf945d7f294014605fd3239 Mon Sep 17 00:00:00 2001 From: Nathan West <nathan.west@okstate.edu> Date: Mon, 5 Oct 2015 18:15:20 -0400 Subject: blocks: fix destruction and shutdown for socket_pdu This removes the inheritance from stream_pdu_base and stop the io_service and internal service thread when stop() and dtor are called. --- gr-blocks/lib/socket_pdu_impl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gr-blocks/lib/socket_pdu_impl.h') diff --git a/gr-blocks/lib/socket_pdu_impl.h b/gr-blocks/lib/socket_pdu_impl.h index c0262ce59a..e45f6d4463 100644 --- a/gr-blocks/lib/socket_pdu_impl.h +++ b/gr-blocks/lib/socket_pdu_impl.h @@ -30,12 +30,15 @@ namespace gr { namespace blocks { - class socket_pdu_impl : public socket_pdu, public stream_pdu_base + class socket_pdu_impl : public socket_pdu { private: boost::asio::io_service d_io_service; std::vector<char> d_rxbuf; void run_io_service() { d_io_service.run(); } + gr::thread::thread d_thread; + bool d_started; + bool d_finished; // TCP specific boost::asio::ip::tcp::endpoint d_tcp_endpoint; @@ -62,6 +65,8 @@ namespace gr { public: socket_pdu_impl(std::string type, std::string addr, std::string port, int MTU = 10000, bool tcp_no_delay = false); + ~socket_pdu_impl(); + bool stop(); }; } /* namespace blocks */ -- cgit v1.2.3