Kea  1.9.9-git
tcp_acceptor.h
Go to the documentation of this file.
1 // Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef TCP_ACCEPTOR_H
8 #define TCP_ACCEPTOR_H
9 
10 #ifndef BOOST_ASIO_HPP
11 #error "asio.hpp must be included before including this, see asiolink.h as to why"
12 #endif
13 
14 #include <asiolink/io_acceptor.h>
15 #include <asiolink/io_service.h>
16 #include <asiolink/io_socket.h>
17 #include <asiolink/tcp_endpoint.h>
18 #include <asiolink/tcp_socket.h>
19 #include <boost/shared_ptr.hpp>
20 #include <netinet/in.h>
21 
22 namespace isc {
23 namespace asiolink {
24 
31 template<typename C>
32 class TCPAcceptor : public IOAcceptor<boost::asio::ip::tcp, C> {
33 public:
34 
38  explicit TCPAcceptor(IOService& io_service)
39  : IOAcceptor<boost::asio::ip::tcp, C>(io_service) {
40  }
41 
45  virtual int getProtocol() const final {
46  return (IPPROTO_TCP);
47  }
48 
59  template<typename SocketCallback>
60  void asyncAccept(const TCPSocket<SocketCallback>& socket, C& callback) {
62  }
63 };
64 
65 
66 } // namespace asiolink
67 } // namespace isc
68 
69 #endif
Defines the logger used by the top-level component of kea-dhcp-ddns.