22 #ifndef HTTP_SERVER_HPP 23 #define HTTP_SERVER_HPP 28 #include <boost/asio.hpp> 37 class HttpServer :
public boost::enable_shared_from_this<HttpServer>
44 void stopRequest ( shared_ptr<HttpRequest> request );
void stopRequest(shared_ptr< HttpRequest > request)
Stops a HttpRequest and deletes it from the request list.
shared_ptr< Configuration > config
TESTABLE void quit()
Cleans up the HttpServer.
std::set< shared_ptr< HttpRequest > > requests
The managed requests.
void start_accept()
Prepares the HttpServer for a new connection and waits asynchronous for it.
TESTABLE void listen()
The HttpServer starts listening for new connections.
boost::asio::ip::tcp::acceptor acceptor
Acceptor used to listen for incoming requests.
boost::asio::signal_set signals
The signal_set is used to register process termination notifications.
A HttpServer waits for connections and creates HttpRequests.
shared_ptr< HttpRequest > nextRequest
The next connection to be accepted.
HttpServer(const shared_ptr< Configuration > &config, const shared_ptr< RequestManager > &manager)
This file is part of alaCarte.
Represents a set of options accessible via strings.
shared_ptr< RequestManager > manager
boost::asio::io_service io_service
The io_service used to perform asynchronous operations.
void handle_accept(const boost::system::error_code &e)
Called when a new client connects to the server.