--- /dev/null
+/* $Id$
+
+This file is part of libmsphttp
+Copyright © 2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the LGPL
+*/
+
+#ifndef MSP_HTTP_SERVER_H_
+#define MSP_HTTP_SERVER_H_
+
+#include <msp/core/refptr.h>
+#include <msp/io/eventdispatcher.h>
+#include <msp/net/streamlistensocket.h>
+
+namespace Msp {
+namespace Http {
+
+class Request;
+class Response;
+
+class Server
+{
+public:
+ sigc::signal<void, const Request &, Response &> signal_request;
+
+private:
+ struct Client
+ {
+ RefPtr<Net::StreamSocket> sock;
+ std::string in_buf;
+ Request *request;
+ bool stale;
+
+ Client(RefPtr<Net::StreamSocket>);
+ ~Client();
+ };
+
+ Net::StreamListenSocket sock;
+ std::list<Client> clients;
+ IO::EventDispatcher *event_disp;
+
+public:
+ Server(unsigned);
+ void use_event_dispatcher(IO::EventDispatcher *);
+private:
+ void data_available();
+ void client_data_available(Client &);
+ void client_end_of_file(Client &);
+};
+
+} // namespace Http
+} // namespace Msp
+
+#endif