Kea 3.3.3
mt_lease_query_mgr.cc
Go to the documentation of this file.
1// Copyright (C) 2022-2026 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#include <config.h>
8
10#include <asiolink/io_address.h>
11#include <asiolink/io_error.h>
12#include <asiolink/io_service.h>
15
16#include <boost/pointer_cast.hpp>
17
18using namespace isc::asiolink;
19using namespace isc::tcp;
20using namespace isc::util;
21
22namespace ph = std::placeholders;
23
24namespace isc {
25namespace lease_query {
26
28 const uint16_t port,
29 const uint16_t family,
30 const tcp::TcpListener::IdleTimeout& idle_timeout,
31 const uint16_t thread_pool_size /* = 1 */,
32 TlsContextPtr context /* = () */,
33 TcpConnectionFilterCallback connection_filter /* = 0 */,
34 const size_t max_concurrent_queries /* = 0 */)
36 this, ph::_1, ph::_2, ph::_3, ph::_4, ph::_5,
37 ph::_6),
38 address, port, thread_pool_size, context,
39 connection_filter),
40 family_(family),
41 max_concurrent_queries_(max_concurrent_queries) {
42 setIdleTimeout(idle_timeout.value_);
43}
44
47 const asiolink::IOAddress& server_address,
48 const unsigned short server_port,
49 const asiolink::TlsContextPtr& tls_context,
50 const TcpListener::IdleTimeout& idle_timeout,
51 const TcpConnectionFilterCallback& connection_filter) {
52 TcpListenerPtr listener(new LeaseQueryListener(io_service,
53 server_address,
54 server_port,
55 tls_context,
56 idle_timeout,
57 connection_filter,
58 family_,
59 max_concurrent_queries_));
60 return (listener);
61}
62
63
67
68} // namespace isc::lease_query
69} // namespace isc
Derivation of TcpListener specific to Bulk Lease Query.
tcp::TcpListenerPtr listenerFactory(const asiolink::IOServicePtr &io_service, const asiolink::IOAddress &server_address, const unsigned short server_port, const asiolink::TlsContextPtr &tls_context, const tcp::TcpListener::IdleTimeout &idle_timeout, const tcp::TcpConnectionFilterCallback &connection_filter)
Defines a factory function for creating listeners.
MtLeaseQueryListenerMgr(const asiolink::IOAddress &address, const uint16_t port, const uint16_t family, const tcp::TcpListener::IdleTimeout &idle_timeout, const uint16_t thread_pool_size=1, asiolink::TlsContextPtr context=asiolink::TlsContextPtr(), tcp::TcpConnectionFilterCallback connection_filter=0, const size_t max_concurrent_queries=0)
Constructor.
MtTcpListenerMgr(TcpListenerFactory listener_factory, const asiolink::IOAddress &address, const uint16_t port, const uint16_t thread_pool_size=1, asiolink::TlsContextPtr context=asiolink::TlsContextPtr(), TcpConnectionFilterCallback connection_filter=0)
Constructor.
void setIdleTimeout(long milliseconds)
Sets the idle time per connection.
void stop()
Stops the listener's thread pool.
std::function< bool(const boost::asio::ip::tcp::endpoint &)> TcpConnectionFilterCallback
Type of the callback for filtering new connections by ip address.
boost::shared_ptr< TcpListener > TcpListenerPtr
Pointer to a TcpListener.
Defines the logger used by the top-level component of kea-lfc.
Idle connection timeout.
long value_
Connection idle timeout value specified.