Kea  1.9.9-git
io_socket.h
Go to the documentation of this file.
1 // Copyright (C) 2010-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 IO_SOCKET_H
8 #define IO_SOCKET_H 1
9 
10 // IMPORTANT NOTE: only very few ASIO headers files can be included in
11 // this file. In particular, asio.hpp should never be included here.
12 // See the description of the namespace below.
13 #include <unistd.h> // for some network system calls
14 
15 #include <functional>
16 #include <string>
17 
18 #include <exceptions/exceptions.h>
19 
20 namespace isc {
21 namespace asiolink {
22 
37 class IOSocket {
38 public:
39 
41 
42 
44  typedef boost::asio::socket_base::reuse_address ReuseAddress;
45 
47 
53 
54 private:
55  IOSocket(const IOSocket& source);
56  IOSocket& operator=(const IOSocket& source);
57 protected:
62  IOSocket() {}
63 public:
65  virtual ~IOSocket() {}
67 
88  virtual int getNative() const = 0;
89 
99  virtual int getProtocol() const = 0;
100 
114  static IOSocket& getDummyUDPSocket();
115 
122  static IOSocket& getDummyTCPSocket();
123 };
124 
125 } // namespace asiolink
126 } // namespace isc
127 
128 #endif // IO_SOCKET_H
Defines the logger used by the top-level component of kea-dhcp-ddns.