1 #ifndef MSP_HTTP_CLIENT_H_
2 #define MSP_HTTP_CLIENT_H_
5 #include <sigc++/signal.h>
6 #include <msp/io/eventdispatcher.h>
7 #include <msp/net/streamsocket.h>
12 class client_busy: public std::logic_error
15 client_busy(): std::logic_error(std::string()) { }
16 virtual ~client_busy() throw() { }
25 sigc::signal<void, const Response &> signal_response_complete;
26 sigc::signal<void, const std::exception &> signal_socket_error;
29 Net::StreamSocket *sock;
30 IO::EventDispatcher *event_disp;
31 std::string user_agent;
36 Client(const Client &);
37 Client &operator=(const Client &);
42 void use_event_dispatcher(IO::EventDispatcher *);
43 void set_user_agent(const std::string &);
44 void start_request(const Request &);
45 const Response *get_url(const std::string &);
49 const Request *get_request() const { return request; }
50 const Response *get_response() const { return response; }
52 void connect_finished(const std::exception *);
53 void data_available();