Kea  1.9.9-git
isc::asiolink::TCPAcceptor< C > Class Template Reference

Provides a service for accepting new TCP connections. More...

#include <tcp_acceptor.h>

+ Inheritance diagram for isc::asiolink::TCPAcceptor< C >:

Public Member Functions

 TCPAcceptor (IOService &io_service)
 Constructor. More...
 
template<typename SocketCallback >
void asyncAccept (const TCPSocket< SocketCallback > &socket, C &callback)
 Asynchronously accept new connection. More...
 
virtual int getProtocol () const final
 Returns protocol of the socket. More...
 

Additional Inherited Members

Detailed Description

template<typename C>
class isc::asiolink::TCPAcceptor< C >

Provides a service for accepting new TCP connections.

Internally it uses boost::asio::ip::tcp::acceptor class to implement the acceptor service.

Template Parameters
CAcceptor callback type.

Definition at line 32 of file tcp_acceptor.h.

Constructor & Destructor Documentation

template<typename C >
isc::asiolink::TCPAcceptor< C >::TCPAcceptor ( IOService io_service)
inlineexplicit

Constructor.

Parameters
io_serviceIO service.

Definition at line 38 of file tcp_acceptor.h.

Member Function Documentation

template<typename C >
template<typename SocketCallback >
void isc::asiolink::TCPAcceptor< C >::asyncAccept ( const TCPSocket< SocketCallback > &  socket,
C &  callback 
)
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.

Parameters
socketSocket into which connection should be accepted.
callbackCallback function to be invoked when the new connection arrives.
Template Parameters
SocketCallbackType of the callback for the TCPSocket.

Definition at line 60 of file tcp_acceptor.h.

References isc::asiolink::IOAcceptor< ProtocolType, CallbackType >::asyncAcceptInternal().

+ Here is the call graph for this function:

template<typename C >
virtual int isc::asiolink::TCPAcceptor< C >::getProtocol ( ) const
inlinefinalvirtual

Returns protocol of the socket.

Returns
IPPROTO_TCP.

Implements isc::asiolink::IOSocket.

Definition at line 45 of file tcp_acceptor.h.


The documentation for this class was generated from the following file: