X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fclient.h;h=ee10f8c1cb5a0e389d860c6b9c59ee6a45aeb9a4;hb=1c965907682f4714db7b952915cf5b6bf9b7f4c1;hp=d72cbadf8333a486adc201696a78ed323738def4;hpb=070d56e7b0036ca2e4234eb06dcae83ebfb3df34;p=libs%2Fnet.git diff --git a/source/client.h b/source/client.h index d72cbad..ee10f8c 100644 --- a/source/client.h +++ b/source/client.h @@ -1,10 +1,3 @@ -/* $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_ @@ -21,18 +14,18 @@ class Response; class Client { +public: + sigc::signal signal_response_complete; + sigc::signal signal_socket_error; + private: Net::StreamSocket *sock; IO::EventDispatcher *event_disp; + std::string user_agent; Request *request; Response *response; std::string in_buf; -public: - sigc::signal signal_response_complete; - sigc::signal signal_socket_error; - -private: Client(const Client &); Client &operator=(const Client &); public: @@ -40,15 +33,16 @@ public: ~Client(); void use_event_dispatcher(IO::EventDispatcher *); + void set_user_agent(const std::string &); void start_request(const Request &); - void get_url(const std::string &); + const Response *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 connect_finished(const std::exception *); void data_available(); };