Kea 2.7.7
io_socket.h
Go to the documentation of this file.
1// Copyright (C) 2010-2025 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#include <boost/asio/socket_base.hpp>
18
20
21namespace isc {
22namespace asiolink {
23
38class IOSocket {
39public:
40
42
43
45 typedef boost::asio::socket_base::reuse_address ReuseAddress;
46
48
54
55private:
56 IOSocket(const IOSocket& source);
57 IOSocket& operator=(const IOSocket& source);
58protected:
64public:
66 virtual ~IOSocket() {}
68
89 virtual int getNative() const = 0;
90
100 virtual int getProtocol() const = 0;
101
115 static IOSocket& getDummyUDPSocket();
116
123 static IOSocket& getDummyTCPSocket();
124};
125
126} // namespace asiolink
127} // namespace isc
128
129#endif // IO_SOCKET_H
Defines the logger used by the top-level component of kea-lfc.