diff --git a/CMakeLists.txt b/CMakeLists.txt index 9524d4956..7ed45c4c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -746,7 +746,7 @@ if(Boost_VERSION_STRING VERSION_LESS 1.73) endif() # Workaround for https://github.com/boostorg/format/issues/67 -if(Boost_VERSION_STRING VERSION_GREATER 1.71) +if((Boost_VERSION_STRING VERSION_GREATER 1.71) AND (Boost_VERSION_STRING VERSION_LESS 1.73)) set(CMAKE_CXX_STANDARD 17) endif() diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 6ad2e2af8..c94c0195a 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -21,7 +21,7 @@ #include "rtl_tcp_signal_source_c.h" #include "rtl_tcp_commands.h" -#include +#include #include #include #include @@ -135,13 +135,13 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, // 6. Start reading #if BOOST_173_OR_GREATER - boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); + boost::asio::async_read(socket_, boost::asio::buffer(data_), + boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); // NOLINT(modernize-avoid-bind) #else boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, _1, _2)); // NOLINT(modernize-avoid-bind) #endif - boost::thread( #if HAS_GENERIC_LAMBDA [ObjectPtr = &io_context_] { ObjectPtr->run(); }); @@ -318,10 +318,16 @@ void rtl_tcp_signal_source_c::handle_read(const boost::system::error_code &ec, } // let woker know that more data is available not_empty_.notify_one(); - // Read some more +// Read some more +#if BOOST_173_OR_GREATER + boost::asio::async_read(socket_, + boost::asio::buffer(data_), + boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); // NOLINT(modernize-avoid-bind) +#else boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, _1, _2)); // NOLINT(modernize-avoid-bind) +#endif } }