boost.png (6897 bytes)

PrevUpHomeNext

Class template acceptor

boost::net::socket::acceptor — Socket acceptor.

Synopsis

template<typename Demultiplexer, typename ConnectionSynchronisation, 
         typename SocketErrorPolicy, typename EventHandler> 
class acceptor {
public:
  // types
  typedef acceptor_impl< ConnectionSynchronisation, Demultiplexer, typename Demultiplexer::synchronisation_type, SocketErrorPolicy, EventHandler > base_t;

  // construct/copy/destruct
  acceptor(Demultiplexer &);

  // public member functions
  template<typename Endpoint> 
    acceptor_error open(const Endpoint &, std::size_t = 1) ;
  acceptor_error accept() ;
  template<typename AHandler> void attach(AHandler *) ;
  void on_accepted(const boost::function< typename net::socket::on_accepted_tag::fn_type > &) ;
  void on_acceptor_error(const boost::function< typename net::on_acceptor_error_tag::fn_type > &) ;
};

Description

Acceptor is a class that accepts incoming connections. Private inheritance and forwarding functions used to ensure uniform interface over all implementations.

acceptor construct/copy/destruct

  1. acceptor(Demultiplexer & demux);

    Parameters

    demux

    demultiplexer to use

acceptor public member functions

  1. template<typename Endpoint> 
      acceptor_error open(const Endpoint & endpoint, std::size_t backlog = 1) ;

    Once the acceptor is open, it can accept connections using accept().

    Parameters

    backlog

    number of pending connections that may be queued

    endpoint

    a socket endpoint

  2. acceptor_error accept() ;
  3. template<typename AHandler> void attach(AHandler * handler) ;
  4. void on_accepted(const boost::function< typename net::socket::on_accepted_tag::fn_type > & handler) ;
  5. void on_acceptor_error(const boost::function< typename net::on_acceptor_error_tag::fn_type > & handler) ;
Copyright © 2004 Hugo Duncan

PrevUpHomeNext