--- /dev/null
+/* $Id$
+
+This file is part of libmsphttp
+Copyright © 2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the LGPL
+*/
+
+#ifndef MSP_HTTP_CLIENT_H_
+#define MSP_HTTP_CLIENT_H_
+
+#include <string>
+#include <sigc++/signal.h>
+#include <msp/io/eventdispatcher.h>
+#include <msp/net/streamsocket.h>
+
+namespace Msp {
+namespace Http {
+
+class Request;
+class Response;
+
+class Client
+{
+private:
+ Net::StreamSocket *sock;
+ IO::EventDispatcher *event_disp;
+ Request *request;
+ Response *response;
+ std::string in_buf;
+
+public:
+ sigc::signal<void, const Response &> signal_response_complete;
+ sigc::signal<void, int> signal_socket_error;
+
+private:
+ Client(const Client &);
+ Client &operator=(const Client &);
+public:
+ Client();
+ ~Client();
+
+ void use_event_dispatcher(IO::EventDispatcher *);
+ void start_request(const Request &);
+ void get_url(const std::string &);
+ void tick();
+ void wait_response();
+ void abort();
+ const Request *get_request() const { return request; }
+ const Response *get_response() const { return response; }
+private:
+ void connect_finished(int);
+ void data_available();
+};
+
+} // namespace Http
+} // namespace Msp
+
+#endif