summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/socket_pdu_impl.h
diff options
context:
space:
mode:
authorNathan West <nathan.west@okstate.edu>2015-10-05 18:15:20 -0400
committerNathan West <nathan.west@okstate.edu>2015-10-07 20:42:14 -0400
commitbde02e814e7f68e6ebf945d7f294014605fd3239 (patch)
tree3d1dd558d67f307bef80c08fb784ed4610666b55 /gr-blocks/lib/socket_pdu_impl.h
parent7d9f13824e9986650a2f46806d6d6714b99780ce (diff)
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.
Diffstat (limited to 'gr-blocks/lib/socket_pdu_impl.h')
-rw-r--r--gr-blocks/lib/socket_pdu_impl.h7
1 files changed, 6 insertions, 1 deletions
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 */