connector class hinzugefuegt und in client "eingebaut"
[ssftp.git] / src / client / client.hpp
blob8d08668ed88474c8b65c243799372bad12e57dda
1 #ifndef client_hpp_INCLUDED
2 #define client_hpp_INCLUDED
4 #include <string>
5 #include <boost/asio.hpp>
6 #include <boost/shared_ptr.hpp>
7 #include "session.hpp"
8 #include "model.hpp"
9 #include "../connection.hpp"
10 #include "../connector.hpp"
13 namespace ssftp
15 namespace client
17 class client : public model
19 boost::asio::io_service io_service;
20 boost::asio::io_service::work work;
21 session_ptr session_ptr_;
23 void user_cmd_handler();
25 public:
26 client();
27 virtual ~client();
29 session_ptr session_ptr() { return session_ptr_; }
31 bool connect(std::string ip, unsigned short port);
33 template<typename handler_type>
34 void async_connect(std::string host, unsigned short port, handler_type handler)
36 connector connector(session_ptr_->socket());
37 connector.async_login(host, port, handler);
40 //proxies
41 void async_login(std::string username, std::string password, response_handler handler);
44 typedef boost::shared_ptr<client> client_ptr;
48 #endif