 |
Kea
1.5.0
|
Go to the documentation of this file.
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
void close() const
Closes the acceptor.
virtual ~IOAcceptor()
Destructor.
void asyncAcceptInternal(const SocketType &socket, const CallbackType &callback)
Asynchronously accept new connection.
The IOService class is a wrapper for the ASIO io_service class.
virtual int getNative() const
Returns file descriptor of the underlying socket.
void bind(const EndpointType &endpoint)
Binds socket to an endpoint.
void setOption(const SettableSocketOption &socket_option)
Sets socket option.
bool isOpen() const
Checks if the acceptor is open.
The IOSocket class is an abstract base class to represent various types of network sockets.
Defines the logger used by the top-level component of kea-dhcp-ddns.
IOAcceptor(IOService &io_service)
Constructor.
void listen()
Starts listening new connections.
A wrapper interface for the ASIO library.
Base class for acceptor services in Kea.
void open(const EndpointType &endpoint)
Opens acceptor socket given the endpoint.
boost::shared_ptr< typename ProtocolType::acceptor > acceptor_
Underlying ASIO acceptor implementation.