AC_CHECK_HEADERS(boost/integer/common_factor.hpp)
+AC_CHECK_HEADERS(boost/asio/io_context.hpp,,AC_MSG_ERROR([Missing boost asio io_context header: boost version must be at least 1.66]))
+
# Verify that the path does not include standard headers by mistake.
# There are two regex.h headers: one is a standard system header (usually
# in /usr/include) and the second one is provided by boost. If you specify the
/// @brief Returns file descriptor of the underlying socket.
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (acceptor_->native());
-#else
return (acceptor_->native_handle());
-#endif
}
/// @brief Opens acceptor socket given the endpoint.
#include <sys/socket.h>
#include <netinet/in.h>
+#if BOOST_VERSION < 106600
+#error "Boost ASIO older than 1.66 are not supported"
+#endif
+
using namespace boost::asio;
using boost::asio::ip::udp;
using boost::asio::ip::tcp;
work_.reset();
}
- /// @brief Return the native @c io_service object used in this wrapper.
+ /// @brief Return the native @c io_context object used in this wrapper.
///
/// This is a short term work around to support other Kea modules
- /// that share the same @c io_service with the authoritative server.
+ /// that share the same @c io_context with the authoritative server.
/// It will eventually be removed once the wrapper interface is
/// generalized.
- boost::asio::io_service& getInternalIOService() {
+ boost::asio::io_context& getInternalIOService() {
return (io_service_);
}
}
private:
- boost::asio::io_service io_service_;
- boost::asio::executor_work_guard<boost::asio::io_service::executor_type> work_;
+ boost::asio::io_context io_service_;
+ boost::asio::executor_work_guard<boost::asio::io_context::executor_type> work_;
};
IOService::IOService() : io_impl_(new IOServiceImpl()) {
io_impl_->stopWork();
}
-boost::asio::io_service&
+boost::asio::io_context&
IOService::getInternalIOService() {
return (io_impl_->getInternalIOService());
}
#include <functional>
#include <list>
-namespace boost {
-namespace asio {
#if BOOST_VERSION < 106600
- class io_service;
-#else
- class io_context;
- typedef io_context io_service;
+#error "Boost ASIO older than 1.66 are not supported"
#endif
+
+// Include boost/asio/io_context.hpp instead?
+namespace boost {
+namespace asio {
+class io_context;
}
}
/// @brief Defines a smart pointer to an IOService instance.
typedef boost::shared_ptr<IOService> IOServicePtr;
-/// @brief The @ref IOService class is a wrapper for the ASIO @c io_service
+/// @brief The @ref IOService class is a wrapper for the ASIO @c io_context
/// class.
class IOService {
/// @brief Constructors and Destructor.
/// when all handlers have been invoked.
void stopWork();
- /// @brief Return the native @c io_service object used in this wrapper.
+ /// @brief Return the native @c io_context object used in this wrapper.
///
/// This is a short term work around to support other Kea modules
- /// that share the same @c io_service with the authoritative server.
+ /// that share the same @c io_context with the authoritative server.
/// It will eventually be removed once the wrapper interface is
/// generalized.
///
- /// @return The internal io_service object.
- boost::asio::io_service& getInternalIOService();
+ /// @return The internal io_context object.
+ boost::asio::io_context& getInternalIOService();
/// @brief Post a callback to the end of the queue.
///
/// \brief Return file descriptor of underlying socket
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (socket_.native());
-#else
return (socket_.native_handle());
-#endif
}
/// \brief Return protocol of socket
/// @brief Return file descriptor of underlying socket.
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (socket_.native());
-#else
return (socket_.native_handle());
-#endif
}
/// @brief Return protocol of socket.
/// \brief Return file descriptor of underlying socket
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (socket_.native());
-#else
return (socket_.native_handle());
-#endif
}
/// \brief Return protocol of socket
int
UnixDomainSocket::getNative() const {
-#if BOOST_VERSION < 106600
- return (impl_->socket_.native());
-#else
return (impl_->socket_.native_handle());
-#endif
}
int