11#error "asio.hpp must be included before including this, see asiolink.h as to why"
33template<
typename ProtocolType,
typename CallbackType>
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);
130 boost::shared_ptr<typename ProtocolType::acceptor>
acceptor_;
Base class for acceptor services in Kea.
IOAcceptor(const IOServicePtr &io_service)
Constructor.
virtual ~IOAcceptor()
Destructor.
bool isOpen() const
Checks if the acceptor is open.
void close() const
Closes the acceptor.
void listen()
Starts listening new connections.
void asyncAcceptInternal(const SocketType &socket, const CallbackType &callback)
Asynchronously accept new connection.
IOServicePtr io_service_
The IO service used to handle events.
boost::shared_ptr< typename ProtocolType::acceptor > acceptor_
Underlying ASIO acceptor implementation.
virtual int getNative() const
Returns file descriptor of the underlying socket.
void setOption(const SettableSocketOption &socket_option)
Sets socket option.
void open(const EndpointType &endpoint)
Opens acceptor socket given the endpoint.
void bind(const EndpointType &endpoint)
Binds socket to an endpoint.
The IOSocket class is an abstract base class to represent various types of network sockets.
A wrapper interface for the ASIO library.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
Defines the logger used by the top-level component of kea-lfc.