diff --git a/.github/workflows/gha.yml b/.github/workflows/gha.yml index 269107224..8953f1b3c 100644 --- a/.github/workflows/gha.yml +++ b/.github/workflows/gha.yml @@ -73,14 +73,14 @@ jobs: export CFLAGS=${S_CFLAGS} && export CXXFLAGS=${S_CXXFLAGS} && export LDFLAGS=${S_LDFLAGS} [ ${{ matrix.pattern }} == 0 ] || [ ${{ matrix.pattern }} == 4 ] || [ ${{ matrix.pattern }} == 5 ] || [ ${{ matrix.pattern }} == 6 ] || [ ${{ matrix.pattern }} == 7 ] && \ export CFLAGS=${NS_CFLAGS} && export CXXFLAGS=${NS_CXXFLAGS} && export LDFLAGS=${NS_LDFLAGS} - [ ${{ matrix.pattern }} == 0 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=ON -DMQTT_TEST_2=ON -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=ON -DMQTT_STD_ANY=OFF -DMQTT_STD_OPTIONAL=OFF -DMQTT_STD_VARIANT=OFF -DMQTT_STD_STRING_VIEW=OFF -DMQTT_STD_SHARED_PTR_ARRAY=OFF -DMQTT_NO_TS_EXECUTORS=OFF" - [ ${{ matrix.pattern }} == 1 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=ON -DMQTT_TEST_2=ON -DMQTT_TEST_3=ON -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=OFF -DMQTT_STD_OPTIONAL=OFF -DMQTT_STD_VARIANT=OFF -DMQTT_STD_STRING_VIEW=OFF -DMQTT_STD_SHARED_PTR_ARRAY=OFF -DMQTT_NO_TS_EXECUTORS=OFF" - [ ${{ matrix.pattern }} == 2 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=ON -DMQTT_TEST_5=ON -DMQTT_TEST_6=ON -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF -DMQTT_NO_TS_EXECUTORS=OFF" - [ ${{ matrix.pattern }} == 3 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=ON -DMQTT_BUILD_EXAMPLES=ON -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF -DMQTT_NO_TS_EXECUTORS=OFF" - [ ${{ matrix.pattern }} == 4 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=ON -DMQTT_TEST_2=ON -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=ON -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=ON -DMQTT_NO_TS_EXECUTORS=ON" - [ ${{ matrix.pattern }} == 5 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=ON -DMQTT_TEST_4=ON -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF -DMQTT_NO_TS_EXECUTORS=OFF" - [ ${{ matrix.pattern }} == 6 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=ON -DMQTT_TEST_6=ON -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF -DMQTT_NO_TS_EXECUTORS=OFF" - [ ${{ matrix.pattern }} == 7 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=ON -DMQTT_BUILD_EXAMPLES=ON -DMQTT_USE_TLS=ON -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=OFF -DMQTT_USE_LOG=ON -DMQTT_STD_ANY=OFF -DMQTT_STD_OPTIONAL=OFF -DMQTT_STD_VARIANT=OFF -DMQTT_STD_STRING_VIEW=OFF -DMQTT_STD_SHARED_PTR_ARRAY=OFF -DMQTT_NO_TS_EXECUTORS=OFF" + [ ${{ matrix.pattern }} == 0 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=ON -DMQTT_TEST_2=ON -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=ON -DMQTT_STD_ANY=OFF -DMQTT_STD_OPTIONAL=OFF -DMQTT_STD_VARIANT=OFF -DMQTT_STD_STRING_VIEW=OFF -DMQTT_STD_SHARED_PTR_ARRAY=OFF" + [ ${{ matrix.pattern }} == 1 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=ON -DMQTT_TEST_2=ON -DMQTT_TEST_3=ON -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=OFF -DMQTT_STD_OPTIONAL=OFF -DMQTT_STD_VARIANT=OFF -DMQTT_STD_STRING_VIEW=OFF -DMQTT_STD_SHARED_PTR_ARRAY=OFF" + [ ${{ matrix.pattern }} == 2 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=ON -DMQTT_TEST_5=ON -DMQTT_TEST_6=ON -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF" + [ ${{ matrix.pattern }} == 3 ] && FLAGS="-DCMAKE_CXX_COMPILER=clang++ -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=ON -DMQTT_BUILD_EXAMPLES=ON -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF" + [ ${{ matrix.pattern }} == 4 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=ON -DMQTT_TEST_2=ON -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=ON -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=ON" + [ ${{ matrix.pattern }} == 5 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=ON -DMQTT_TEST_4=ON -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF" + [ ${{ matrix.pattern }} == 6 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=ON -DMQTT_TEST_6=ON -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF" + [ ${{ matrix.pattern }} == 7 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=ON -DMQTT_BUILD_EXAMPLES=ON -DMQTT_USE_TLS=ON -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=OFF -DMQTT_USE_LOG=ON -DMQTT_STD_ANY=OFF -DMQTT_STD_OPTIONAL=OFF -DMQTT_STD_VARIANT=OFF -DMQTT_STD_STRING_VIEW=OFF -DMQTT_STD_SHARED_PTR_ARRAY=OFF" echo "begin" echo ${{env.BOOST_ROOT}} diff --git a/CMakeLists.txt b/CMakeLists.txt index 03bafaf06..c75282465 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,6 @@ OPTION(MQTT_STD_STRING_VIEW "Use std::string_view from C++17 instead of boost::s OPTION(MQTT_STD_ANY "Use std::any from C++17 instead of boost::any" OFF) OPTION(MQTT_STD_SHARED_PTR_ARRAY "Use std::shared_ptr from C++17 instead of boost::shared_ptr" OFF) OPTION(MQTT_DISABLE_LIBSTDCXX_TUPLE_ANY_WORKAROUND "std::tuple workaround for libstdc++" OFF) -OPTION(MQTT_NO_TS_EXECUTORS "Use standard executors instead of Networking TS-style executors" OFF) IF (POLICY CMP0074) CMAKE_POLICY(SET CMP0074 NEW) @@ -88,13 +87,6 @@ ELSE () MESSAGE (STATUS "std::tuple workaround for libstdc++ enabled") ENDIF () -IF (MQTT_NO_TS_EXECUTORS) - MESSAGE (STATUS "Using standard executors instead of Networking TS-style executors") -ELSE () - MESSAGE (STATUS "Using Networking TS-style executors instead of standard executors") -ENDIF () - - IF ( MQTT_STD_VARIANT OR MQTT_STD_OPTIONAL OR MQTT_STD_ANY diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 2024defef..73f704b6a 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -36,7 +36,6 @@ TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$:M TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$:MQTT_STD_STRING_VIEW>) TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$:MQTT_STD_SHARED_PTR_ARRAY>) TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$:MQTT_DISABLE_LIBSTDCXX_TUPLE_ANY_WORKAROUND>) -TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$:MQTT_NO_TS_EXECUTORS>) # You might wonder why we don't simply add the list of header files to the check_deps # executable directly, and let cmake figure everything out on it's own. diff --git a/include/mqtt/config.hpp b/include/mqtt/config.hpp index 7b6ddd587..3909a661b 100644 --- a/include/mqtt/config.hpp +++ b/include/mqtt/config.hpp @@ -32,9 +32,6 @@ #endif // !defined(MQTT_STD_VARIANT) -// Check whether to use standard executors only -#if defined(MQTT_NO_TS_EXECUTORS) - // Determine Boost Asio version #include @@ -43,15 +40,6 @@ #error Boost Asio version 1.18.0 required for no TS-style executors #endif // BOOST_ASIO_VERSION < 101800 -#else // defined(MQTT_NO_TS_EXECUTORS) - -// Force no TS executors if Boost Asio accepts these only -#if defined(BOOST_ASIO_NO_TS_EXECUTORS) -#define MQTT_NO_TS_EXECUTORS -#endif // defined(BOOST_ASIO_NO_TS_EXECUTORS) - -#endif // defined(MQTT_NO_TS_EXECUTORS) - #define BOOST_UUID_FORCE_AUTO_LINK #endif // MQTT_CONFIG_HPP diff --git a/include/mqtt/null_strand.hpp b/include/mqtt/null_strand.hpp index 6ca44c12c..a9f56b0cc 100644 --- a/include/mqtt/null_strand.hpp +++ b/include/mqtt/null_strand.hpp @@ -17,84 +17,9 @@ namespace MQTT_NS { namespace as = boost::asio; -// Determines which strand to use -#if defined(MQTT_NO_TS_EXECUTORS) - // Using standard executor style null_strand / simple executor using null_strand = as::io_context::executor_type; -#else // defined(MQTT_NO_TS_EXECUTORS) - -namespace detail { - -struct null_strand { - explicit null_strand(as::io_context& ioc) noexcept : ioc_(ioc) {} - template - void post(Func&& f, Allocator) const { - as::post( - ioc_, - [f = std::forward(f)] () mutable { - std::move(f)(); - } - ); - } - template - void defer(Func&& f, Allocator) const { - as::defer( - ioc_, - [f = std::forward(f)] () mutable { - std::move(f)(); - } - ); - } - template - void dispatch(Func&& f, Allocator) const { - as::dispatch( - ioc_, - [f = std::forward(f)] () mutable { - std::move(f)(); - } - ); - } - bool running_in_this_thread() const noexcept { return false; } - void on_work_started() const noexcept {} - void on_work_finished() const noexcept {} - as::io_context& context() noexcept{ return ioc_; } - as::io_context const& context() const noexcept { return ioc_; } -private: - as::io_context& ioc_; -}; - -} // namespace detail - -// Use networking TS style null_strand -using null_strand = detail::null_strand; - -inline bool operator==(null_strand const& lhs, null_strand const& rhs) { - return std::addressof(lhs) == std::addressof(rhs); -} - -inline bool operator!=(null_strand const& lhs, null_strand const& rhs) { - return !(lhs == rhs); -} - -#endif // defined(MQTT_NO_TS_EXECUTORS) - } // namespace MQTT_NS - -#if !defined(MQTT_NO_TS_EXECUTORS) - -namespace boost { -namespace asio { - -template<> -struct is_executor : std::true_type { -}; - -} // namespace asio -} // namespace boost - -#endif // !defined(MQTT_NO_TS_EXECUTORS) - #endif // MQTT_NULL_STRAND_HPP diff --git a/include/mqtt/strand.hpp b/include/mqtt/strand.hpp index 1046a00f8..fa83f45d1 100644 --- a/include/mqtt/strand.hpp +++ b/include/mqtt/strand.hpp @@ -16,18 +16,8 @@ namespace MQTT_NS { namespace as = boost::asio; -// Determines which strand to use -#if defined(MQTT_NO_TS_EXECUTORS) - -// Use standard executor style strand using strand = as::strand; -#else // defined(MQTT_NO_TS_EXECUTORS) - -// Use networking TS style strand -using strand = as::io_context::strand; - -#endif // defined(MQTT_NO_TS_EXECUTORS) } #endif // MQTT_STRAND_HPP diff --git a/include/mqtt/tcp_endpoint.hpp b/include/mqtt/tcp_endpoint.hpp index c46a289a8..295ea3109 100644 --- a/include/mqtt/tcp_endpoint.hpp +++ b/include/mqtt/tcp_endpoint.hpp @@ -27,11 +27,7 @@ class tcp_endpoint : public socket { template explicit tcp_endpoint(as::io_context& ioc, Args&&... args) :tcp_(ioc, std::forward(args)...), -#if defined(MQTT_NO_TS_EXECUTORS) strand_(ioc.get_executor()) -#else - strand_(ioc) -#endif {} MQTT_ALWAYS_INLINE void async_read( @@ -115,15 +111,9 @@ class tcp_endpoint : public socket { tcp_.lowest_layer().close(ec); } -#if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - MQTT_ALWAYS_INLINE as::executor get_executor() override final { - return lowest_layer().get_executor(); - } -#else // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) MQTT_ALWAYS_INLINE as::any_io_executor get_executor() override final { - return lowest_layer().get_executor(); + return strand_; } -#endif // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) auto& socket() { return tcp_; } auto const& socket() const { return tcp_; } diff --git a/include/mqtt/type_erased_socket.hpp b/include/mqtt/type_erased_socket.hpp index 02788247b..dffd29223 100644 --- a/include/mqtt/type_erased_socket.hpp +++ b/include/mqtt/type_erased_socket.hpp @@ -34,11 +34,7 @@ class socket { virtual void clean_shutdown_and_close(boost::system::error_code&) = 0; virtual void async_clean_shutdown_and_close(std::function) = 0; virtual void force_shutdown_and_close(boost::system::error_code&) = 0; -#if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - virtual as::executor get_executor() = 0; -#else // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) virtual as::any_io_executor get_executor() = 0; -#endif // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) }; } // namespace MQTT_NS diff --git a/include/mqtt/ws_endpoint.hpp b/include/mqtt/ws_endpoint.hpp index 22b200c26..7b5025de6 100644 --- a/include/mqtt/ws_endpoint.hpp +++ b/include/mqtt/ws_endpoint.hpp @@ -30,11 +30,7 @@ class ws_endpoint : public socket { template explicit ws_endpoint(as::io_context& ioc, Args&&... args) :ws_(ioc, std::forward(args)...), -#if defined(MQTT_NO_TS_EXECUTORS) strand_(ioc.get_executor()) -#else - strand_(ioc) -#endif { ws_.binary(true); ws_.set_option( @@ -230,15 +226,9 @@ class ws_endpoint : public socket { lowest_layer().close(ec); } -#if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - MQTT_ALWAYS_INLINE as::executor get_executor() override final { - return lowest_layer().get_executor(); - } -#else // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) MQTT_ALWAYS_INLINE as::any_io_executor get_executor() override final { - return lowest_layer().get_executor(); + return strand_; } -#endif // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) typename boost::beast::websocket::stream::next_layer_type& next_layer() { return ws_.next_layer();