libiqxmlrpc  0.12.4
 All Classes Namespaces Files Functions Typedefs Enumerations
acceptor.h
1 // Libiqxmlrpc - an object-oriented XML-RPC solution.
2 // Copyright (C) 2011 Anton Dedov
3 
4 #ifndef _libiqnet_acceptor_h_
5 #define _libiqnet_acceptor_h_
6 
7 #include "inet_addr.h"
8 #include "reactor.h"
9 #include "socket.h"
10 
11 namespace iqnet {
12 
14 class Firewall_base;
15 
18 
24 class LIBIQXMLRPC_API Acceptor: public Event_handler {
25  Socket sock;
26  Accepted_conn_factory *factory;
27  Reactor_base *reactor;
28  Firewall_base* firewall;
29 
30 public:
32  virtual ~Acceptor();
33 
34  void set_firewall( iqnet::Firewall_base* );
35 
36  void handle_input( bool& );
37 
38 protected:
39  void finish() {}
40  Socket::Handler get_handler() const { return sock.get_handler(); }
41 
42  void accept();
43  void listen();
44 };
45 
46 } // namespace iqnet
47 
48 #endif