2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 01:49:48 +00:00

[#3696] Made >= 1.66 mandatory

This commit is contained in:
Francis Dupont 2024-12-20 14:40:47 +01:00
parent 120fd3d7c4
commit 1ecfaf9bd6
9 changed files with 23 additions and 37 deletions

View File

@ -101,6 +101,8 @@ AC_CHECK_HEADERS(boost/asio/coroutine.hpp,,AC_MSG_RESULT(not found, using built-
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

View File

@ -47,11 +47,7 @@ public:
/// @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.

View File

@ -19,6 +19,10 @@
#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;

View File

@ -101,13 +101,13 @@ public:
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_);
}
@ -119,8 +119,8 @@ public:
}
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()) {
@ -169,7 +169,7 @@ IOService::stopWork() {
io_impl_->stopWork();
}
boost::asio::io_service&
boost::asio::io_context&
IOService::getInternalIOService() {
return (io_impl_->getInternalIOService());
}

View File

@ -12,14 +12,14 @@
#include <functional>
#include <list>
#if BOOST_VERSION < 106600
#error "Boost ASIO older than 1.66 are not supported"
#endif
// Include boost/asio/io_context.hpp instead?
namespace boost {
namespace asio {
#if BOOST_VERSION < 106600
class io_service;
#else
class io_context;
typedef io_context io_service;
#endif
class io_context;
}
}
@ -32,7 +32,7 @@ class IOService;
/// @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.
@ -99,15 +99,15 @@ public:
/// 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.
///

View File

@ -73,11 +73,7 @@ public:
/// \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

View File

@ -50,11 +50,7 @@ public:
/// @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.

View File

@ -63,11 +63,7 @@ public:
/// \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

View File

@ -289,11 +289,7 @@ UnixDomainSocket::UnixDomainSocket(const IOServicePtr& io_service)
int
UnixDomainSocket::getNative() const {
#if BOOST_VERSION < 106600
return (impl_->socket_.native());
#else
return (impl_->socket_.native_handle());
#endif
}
int