Kea 2.7.5
listener.cc
Go to the documentation of this file.
1// Copyright (C) 2017-2024 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 <http/listener.h>
11#include <http/listener_impl.h>
12
13using namespace isc::asiolink;
14
15namespace isc {
16namespace http {
17
19 const asiolink::IOAddress& server_address,
20 const unsigned short server_port,
21 const TlsContextPtr& tls_context,
22 const HttpResponseCreatorFactoryPtr& creator_factory,
23 const HttpListener::RequestTimeout& request_timeout,
24 const HttpListener::IdleTimeout& idle_timeout)
25 : impl_(new HttpListenerImpl(io_service, server_address, server_port,
26 tls_context, creator_factory,
27 request_timeout.value_,
28 idle_timeout.value_)) {
29}
30
34
37 return (impl_->getEndpoint().getAddress());
38}
39
40uint16_t
42 return (impl_->getEndpoint().getPort());
43}
44
45int
47 return (impl_->getNative());
48}
49
50void
52 impl_->addExternalSockets(use_external);
53}
54
55void
57 impl_->start();
58}
59
60void
62 impl_->stop();
63}
64
65} // end of namespace isc::http
66} // end of namespace isc
Implementation of the HttpListener.
HttpListener(const asiolink::IOServicePtr &io_service, const asiolink::IOAddress &server_address, const unsigned short server_port, const asiolink::TlsContextPtr &tls_context, const HttpResponseCreatorFactoryPtr &creator_factory, const RequestTimeout &request_timeout, const IdleTimeout &idle_timeout)
Constructor.
Definition listener.cc:18
uint16_t getLocalPort() const
Returns local port on which server is listening.
Definition listener.cc:41
asiolink::IOAddress getLocalAddress() const
Returns local address on which server is listening.
Definition listener.cc:36
void addExternalSockets(bool use_external=false)
Use external sockets flag.
Definition listener.cc:51
~HttpListener()
Destructor.
Definition listener.cc:31
void stop()
Stops all active connections and shuts down the service.
Definition listener.cc:61
void start()
Starts accepting new connections.
Definition listener.cc:56
int getNative() const
file descriptor of the underlying acceptor socket.
Definition listener.cc:46
boost::shared_ptr< HttpListenerImpl > impl_
Pointer to the implementation of the HttpListener.
Definition listener.h:146
boost::shared_ptr< HttpResponseCreatorFactory > HttpResponseCreatorFactoryPtr
Pointer to the HttpResponseCreatorFactory.
Defines the logger used by the top-level component of kea-lfc.
Idle connection timeout.
Definition listener.h:67
HTTP request timeout value.
Definition listener.h:56