libcaf  0.15.3
Public Types | Public Member Functions | List of all members
caf::io::network::asio_acceptor< SocketAcceptor > Class Template Reference

An acceptor is responsible for accepting incoming connections. More...

#include <asio_multiplexer.hpp>

Public Types

using manager_type = acceptor_manager
 A manager providing the accept member function.
 
using manager_ptr = intrusive_ptr< manager_type >
 A smart pointer to an acceptor manager.
 

Public Member Functions

 asio_acceptor (asio_multiplexer &am, io_service &io)
 
asio_multiplexerbackend ()
 Returns the multiplexer this acceptor belongs to.
 
SocketAcceptor & socket_handle ()
 Returns the IO socket.
 
const SocketAcceptor & socket_handle () const
 Returns the IO socket.
 
socket_type & accepted_socket ()
 Returns the accepted socket. More...
 
void init (SocketAcceptor fd)
 Initializes this acceptor, setting the socket handle to fd.
 
void start (manager_type *mgr)
 Starts this acceptor, forwarding all incoming connections to manager. More...
 
void activate (manager_type *mgr)
 Starts the accept loop.
 
void passivate ()
 Starts the accept loop.
 
void stop ()
 Closes the network connection, thus stopping this acceptor.
 

Detailed Description

template<class SocketAcceptor>
class caf::io::network::asio_acceptor< SocketAcceptor >

An acceptor is responsible for accepting incoming connections.

Member Function Documentation

template<class SocketAcceptor >
socket_type& caf::io::network::asio_acceptor< SocketAcceptor >::accepted_socket ( )

Returns the accepted socket.

This member function should be called only from the new_connection callback.

template<class SocketAcceptor >
void caf::io::network::asio_acceptor< SocketAcceptor >::start ( manager_type mgr)

Starts this acceptor, forwarding all incoming connections to manager.

The intrusive pointer will be released after the acceptor has been closed or an IO error occured.


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