diff --git a/include/spead2/common_socket.h b/include/spead2/common_socket.h index b8b79e69..2c0eba1d 100644 --- a/include/spead2/common_socket.h +++ b/include/spead2/common_socket.h @@ -51,25 +51,6 @@ void set_socket_send_buffer_size(SocketType &socket, std::size_t buffer_size); template void set_socket_recv_buffer_size(SocketType &socket, std::size_t buffer_size); -#if BOOST_VERSION >= 107000 -/** - * Get an object suitable for constructing another socket with the same IO - * context. The return type depends on the Boost version. This is necessary - * because Boost 1.70 removed @c basic_socket::get_io_context. - */ -template -static inline typename SocketType::executor_type get_socket_executor(SocketType &socket) -{ - return socket.get_executor(); -} -#else -template -static inline boost::asio::io_context &get_socket_executor(SocketType &socket) -{ - return socket.get_io_context(); -} -#endif - /** * Determine whether a socket is using a particular IO context. This is necessary * because Boost 1.70 removed @c basic_socket::get_io_context. @@ -82,10 +63,8 @@ static inline bool socket_uses_io_context(SocketType &socket, boost::asio::io_co typedef boost::asio::io_context::executor_type executor_type; return socket.get_executor().target_type() == typeid(executor_type) && *socket.get_executor().template target() == io_context.get_executor(); -#elif BOOST_VERSION >= 107000 - return socket.get_executor() == io_context.get_executor(); #else - return &socket.get_io_context() == &io_context; + return socket.get_executor() == io_context.get_executor(); #endif } diff --git a/src/recv_tcp.cpp b/src/recv_tcp.cpp index 67453fe8..99a06a2a 100644 --- a/src/recv_tcp.cpp +++ b/src/recv_tcp.cpp @@ -49,7 +49,7 @@ tcp_reader::tcp_reader( buffer(new std::uint8_t[max_size * pkts_per_buffer]), head(buffer.get()), tail(buffer.get()), - peer(get_socket_executor(acceptor)), + peer(acceptor.get_executor()), acceptor(std::move(acceptor)) { assert(socket_uses_io_context(this->acceptor, get_io_context()));