10 #ifndef BOOST_ASIO_HPP
11 #error "asio.hpp must be included before including this, see asiolink.h as to why"
33 template<
typename ProtocolType,
typename CallbackType>
42 acceptor_(new typename ProtocolType::acceptor(io_service.get_io_service())) {
50 #if BOOST_VERSION < 106600
63 template<
typename Endpo
intType>
64 void open(
const EndpointType& endpoint) {
65 acceptor_->open(endpoint.getASIOEndpoint().protocol());
74 template<
typename Endpo
intType>
75 void bind(
const EndpointType& endpoint) {
76 acceptor_->bind(endpoint.getASIOEndpoint());
85 template<
typename SettableSocketOption>
86 void setOption(
const SettableSocketOption& socket_option) {
120 template<
typename SocketType>
122 const CallbackType& callback) {
123 acceptor_->async_accept(socket.getASIOSocket(), callback);
128 boost::shared_ptr<typename ProtocolType::acceptor>
acceptor_;
136 #endif // IO_ACCEPTOR_H
Base class for acceptor services in Kea.
The IOService class is a wrapper for the ASIO io_service class.
void close() const
Closes the acceptor.
IOAcceptor(IOService &io_service)
Constructor.
virtual int getNative() const
Returns file descriptor of the underlying socket.
void open(const EndpointType &endpoint)
Opens acceptor socket given the endpoint.
bool isOpen() const
Checks if the acceptor is open.
void setOption(const SettableSocketOption &socket_option)
Sets socket option.
Defines the logger used by the top-level component of kea-dhcp-ddns.
The IOSocket class is an abstract base class to represent various types of network sockets...
void bind(const EndpointType &endpoint)
Binds socket to an endpoint.
A wrapper interface for the ASIO library.
boost::shared_ptr< typename ProtocolType::acceptor > acceptor_
Underlying ASIO acceptor implementation.
void asyncAcceptInternal(const SocketType &socket, const CallbackType &callback)
Asynchronously accept new connection.
void listen()
Starts listening new connections.
virtual ~IOAcceptor()
Destructor.