2 #include "../command.hpp"
3 #include <boost/thread.hpp>
4 #include <boost/bind.hpp>
9 using namespace boost::asio::ip
;
12 ssftp::client::client::client()
15 thread
thread(boost::bind(&boost::asio::io_service::run
, &io_service
));
18 bool ssftp::client::client::connect(string ip
, unsigned short port
)
20 session_ptr_
.reset(new session(io_service
));
21 tcp::endpoint
ep(address::from_string(ip
), port
);
22 boost::system::error_code error
;
23 session_ptr_
->socket().connect(ep
, error
);
25 session_ptr_
->start();
26 return error
? false : true;
29 void ssftp::client::client::async_login(string username
, string password
, response_callback callback
)
31 session_ptr_
->async_login(username
, password
, callback
);