Kea  1.5.0
isc::http::HttpListenerImpl Class Reference

Implementation of the HttpListener. More...

Public Member Functions

 HttpListenerImpl (asiolink::IOService &io_service, const asiolink::IOAddress &server_address, const unsigned short server_port, const HttpResponseCreatorFactoryPtr &creator_factory, const long request_timeout, const long idle_timeout)
 Constructor. More...
 
const TCPEndpointgetEndpoint () const
 Returns reference to the current listener endpoint. More...
 
void start ()
 Starts accepting new connections. More...
 
void stop ()
 Stops all active connections and shuts down the service. More...
 

Detailed Description

Implementation of the HttpListener.

Definition at line 23 of file listener.cc.

Constructor & Destructor Documentation

◆ HttpListenerImpl()

isc::http::HttpListenerImpl::HttpListenerImpl ( asiolink::IOService io_service,
const asiolink::IOAddress server_address,
const unsigned short  server_port,
const HttpResponseCreatorFactoryPtr creator_factory,
const long  request_timeout,
const long  idle_timeout 
)

Constructor.

This constructor creates new server endpoint using the specified IP address and port. It also validates other specified parameters.

This constructor does not start accepting new connections! To start accepting connections run HttpListener::start.

Parameters
io_serviceIO service to be used by the listener.
server_addressAddress on which the HTTP service should run.
server_portPort number on which the HTTP service should run.
creator_factoryPointer to the caller-defined HttpResponseCreatorFactory derivation which should be used to create HttpResponseCreator instances.
request_timeoutTimeout after which the HTTP Request Timeout is generated.
idle_timeoutTimeout after which an idle persistent HTTP connection is closed by the server.
Exceptions
HttpListenerErrorwhen any of the specified parameters is invalid.

Definition at line 111 of file listener.cc.

References isc_throw.

Member Function Documentation

◆ getEndpoint()

const TCPEndpoint & isc::http::HttpListenerImpl::getEndpoint ( ) const

Returns reference to the current listener endpoint.

Definition at line 149 of file listener.cc.

◆ start()

void isc::http::HttpListenerImpl::start ( )

Starts accepting new connections.

This method starts accepting and handling new HTTP connections on the IP address and port number specified in the constructor.

If the method is invoked successfully, it must not be invoked again until HttpListener::stop is called.

Exceptions
HttpListenerErrorif an error occurred.

Definition at line 154 of file listener.cc.

References isc::asiolink::IOAcceptor< ProtocolType, CallbackType >::bind(), isc_throw, isc::asiolink::IOAcceptor< ProtocolType, CallbackType >::listen(), isc::asiolink::IOAcceptor< ProtocolType, CallbackType >::open(), isc::asiolink::IOAcceptor< ProtocolType, CallbackType >::setOption(), stop(), and isc::Exception::what().

+ Here is the call graph for this function:

◆ stop()

void isc::http::HttpListenerImpl::stop ( )

Stops all active connections and shuts down the service.

Definition at line 171 of file listener.cc.

References isc::asiolink::IOAcceptor< ProtocolType, CallbackType >::close(), and isc::http::HttpConnectionPool::stopAll().

Referenced by start().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: