Kea  1.9.9-git
listener.cc
Go to the documentation of this file.
1 // Copyright (C) 2017-2021 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 
13 using namespace isc::asiolink;
14 
15 namespace isc {
16 namespace http {
17 
18 HttpListener::HttpListener(IOService& io_service,
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 
32  stop();
33 }
34 
37  return (impl_->getEndpoint().getAddress());
38 }
39 
40 uint16_t
42  return (impl_->getEndpoint().getPort());
43 }
44 
45 void
47  impl_->start();
48 }
49 
50 void
52  impl_->stop();
53 }
54 
55 } // end of namespace isc::http
56 } // end of namespace isc
~HttpListener()
Destructor.
Definition: listener.cc:31
boost::shared_ptr< HttpResponseCreatorFactory > HttpResponseCreatorFactoryPtr
Pointer to the HttpResponseCreatorFactory.
Implementation of the HttpListener.
Definition: listener_impl.h:22
void start()
Starts accepting new connections.
Definition: listener.cc:46
boost::shared_ptr< HttpListenerImpl > impl_
Pointer to the implementation of the HttpListener.
Definition: listener.h:135
asiolink::IOAddress getLocalAddress() const
Returns local address on which server is listening.
Definition: listener.cc:36
Idle connection timeout.
Definition: listener.h:67
Defines the logger used by the top-level component of kea-dhcp-ddns.
void stop()
Stops all active connections and shuts down the service.
Definition: listener.cc:51
uint16_t getLocalPort() const
Returns local port on which server is listening.
Definition: listener.cc:41
HTTP request timeout value.
Definition: listener.h:56