![]() |
Kea
1.5.0
|
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 TCPEndpoint & | getEndpoint () 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... | |
Implementation of the HttpListener.
Definition at line 23 of file listener.cc.
| 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.
| io_service | IO service to be used by the listener. |
| server_address | Address on which the HTTP service should run. |
| server_port | Port number on which the HTTP service should run. |
| creator_factory | Pointer to the caller-defined HttpResponseCreatorFactory derivation which should be used to create HttpResponseCreator instances. |
| request_timeout | Timeout after which the HTTP Request Timeout is generated. |
| idle_timeout | Timeout after which an idle persistent HTTP connection is closed by the server. |
| HttpListenerError | when any of the specified parameters is invalid. |
Definition at line 111 of file listener.cc.
References isc_throw.
| const TCPEndpoint & isc::http::HttpListenerImpl::getEndpoint | ( | ) | const |
Returns reference to the current listener endpoint.
Definition at line 149 of file listener.cc.
| 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.
| HttpListenerError | if 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:| 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: