alaCarte Maps
Renderer for OpenStreetMap tiles
|
A HttpServer waits for connections and creates HttpRequests. More...
#include <http_server.hpp>
Public Member Functions | |
HttpServer (const shared_ptr< Configuration > &config, const shared_ptr< RequestManager > &manager) | |
This file is part of alaCarte. More... | |
TESTABLE void | listen () |
The HttpServer starts listening for new connections. More... | |
TESTABLE void | quit () |
Cleans up the HttpServer. More... | |
void | stopRequest (shared_ptr< HttpRequest > request) |
Stops a HttpRequest and deletes it from the request list. More... | |
Private Member Functions | |
void | start_accept () |
Prepares the HttpServer for a new connection and waits asynchronous for it. More... | |
void | handle_accept (const boost::system::error_code &e) |
Called when a new client connects to the server. More... | |
Private Attributes | |
boost::asio::io_service | io_service |
The io_service used to perform asynchronous operations. More... | |
boost::asio::signal_set | signals |
The signal_set is used to register process termination notifications. More... | |
boost::asio::ip::tcp::acceptor | acceptor |
Acceptor used to listen for incoming requests. More... | |
shared_ptr< HttpRequest > | nextRequest |
The next connection to be accepted. More... | |
std::set< shared_ptr< HttpRequest > > | requests |
The managed requests. More... | |
shared_ptr< Configuration > | config |
shared_ptr< RequestManager > | manager |
A HttpServer waits for connections and creates HttpRequests.
Definition at line 37 of file http_server.hpp.
HttpServer::HttpServer | ( | const shared_ptr< Configuration > & | config, |
const shared_ptr< RequestManager > & | manager | ||
) |
This file is part of alaCarte.
alaCarte is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
alaCarte is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with alaCarte. If not, see http://www.gnu.org/licenses/.
Copyright alaCarte 2012-2013 Simon Dreher, Florian Jacob, Tobias Kahlert, Patrick Niklaus, Bernhard Scheirle, Lisa Winter Maintainer: Bernhard Scheirle Creates a new HttpServer with the given Configuration and RequestManager
config | The Configuration which should be used |
manager | The RequestManager in which the HttpRequest should be enqueued. |
Definition at line 35 of file http_server.cpp.
|
private |
Called when a new client connects to the server.
Definition at line 109 of file http_server.cpp.
void HttpServer::listen | ( | ) |
The HttpServer starts listening for new connections.
This function will never return (Blocking call).
Definition at line 57 of file http_server.cpp.
void HttpServer::quit | ( | ) |
Cleans up the HttpServer.
Called when the HttpServer should be terminated.
Definition at line 131 of file http_server.cpp.
|
private |
Prepares the HttpServer for a new connection and waits asynchronous for it.
Definition at line 101 of file http_server.cpp.
void HttpServer::stopRequest | ( | shared_ptr< HttpRequest > | request | ) |
Stops a HttpRequest and deletes it from the request list.
request | The HttpRequest which should be stopped. |
Definition at line 93 of file http_server.cpp.
|
private |
Acceptor used to listen for incoming requests.
Definition at line 58 of file http_server.hpp.
|
private |
Definition at line 66 of file http_server.hpp.
|
private |
The io_service used to perform asynchronous operations.
Definition at line 52 of file http_server.hpp.
|
private |
Definition at line 67 of file http_server.hpp.
|
private |
The next connection to be accepted.
Definition at line 61 of file http_server.hpp.
|
private |
The managed requests.
Definition at line 64 of file http_server.hpp.
|
private |
The signal_set is used to register process termination notifications.
Definition at line 55 of file http_server.hpp.