Kea 2.7.5
|
Provides a service for accepting new TCP connections. More...
#include <tcp_acceptor.h>
Public Member Functions | |
TCPAcceptor (const IOServicePtr &io_service) | |
Constructor. | |
template<typename SocketCallback > | |
void | asyncAccept (const TCPSocket< SocketCallback > &socket, C &callback) |
Asynchronously accept new connection. | |
virtual int | getProtocol () const final |
Returns protocol of the socket. | |
Public Member Functions inherited from isc::asiolink::IOAcceptor< boost::asio::ip::tcp, C > | |
IOAcceptor (const IOServicePtr &io_service) | |
Constructor. | |
virtual | ~IOAcceptor () |
Destructor. | |
void | bind (const EndpointType &endpoint) |
Binds socket to an endpoint. | |
void | close () const |
Closes the acceptor. | |
virtual int | getNative () const |
Returns file descriptor of the underlying socket. | |
bool | isOpen () const |
Checks if the acceptor is open. | |
void | listen () |
Starts listening new connections. | |
void | open (const EndpointType &endpoint) |
Opens acceptor socket given the endpoint. | |
void | setOption (const SettableSocketOption &socket_option) |
Sets socket option. | |
Public Member Functions inherited from isc::asiolink::IOSocket | |
virtual | ~IOSocket () |
The destructor. | |
Additional Inherited Members | |
Public Types inherited from isc::asiolink::IOSocket | |
typedef boost::asio::socket_base::reuse_address | ReuseAddress |
Represents SO_REUSEADDR socket option. | |
Static Public Member Functions inherited from isc::asiolink::IOSocket | |
static IOSocket & | getDummyUDPSocket () |
Return a non-usable "dummy" UDP socket for testing. | |
static IOSocket & | getDummyTCPSocket () |
Return a non-usable "dummy" TCP socket for testing. | |
Protected Member Functions inherited from isc::asiolink::IOAcceptor< boost::asio::ip::tcp, C > | |
void | asyncAcceptInternal (const SocketType &socket, const C &callback) |
Asynchronously accept new connection. | |
Protected Member Functions inherited from isc::asiolink::IOSocket | |
IOSocket () | |
The default constructor. | |
Protected Attributes inherited from isc::asiolink::IOAcceptor< boost::asio::ip::tcp, C > | |
boost::shared_ptr< typename ProtocolType::acceptor > | acceptor_ |
Underlying ASIO acceptor implementation. | |
IOServicePtr | io_service_ |
The IO service used to handle events. | |
Provides a service for accepting new TCP connections.
Internally it uses boost::asio::ip::tcp::acceptor
class to implement the acceptor service.
C | Acceptor callback type. |
Definition at line 32 of file tcp_acceptor.h.
|
inlineexplicit |
|
inline |
Asynchronously accept new connection.
This method accepts new connection into the specified socket. When the new connection arrives or an error occurs the specified callback function is invoked.
socket | Socket into which connection should be accepted. |
callback | Callback function to be invoked when the new connection arrives. |
SocketCallback | Type of the callback for the TCPSocket. |
Definition at line 60 of file tcp_acceptor.h.
References isc::asiolink::IOAcceptor< ProtocolType, CallbackType >::asyncAcceptInternal().
|
inlinefinalvirtual |
Returns protocol of the socket.
Implements isc::asiolink::IOSocket.
Definition at line 45 of file tcp_acceptor.h.