diff options
author | Daniil Rozanov <daniilrozzanov@gmail.com> | 2023-07-05 03:11:34 +0300 |
---|---|---|
committer | Daniil Rozanov <daniilrozzanov@gmail.com> | 2023-07-05 03:11:34 +0300 |
commit | d3f11e3b7b86eda4733ece84294d9dc8da1d23bc (patch) | |
tree | 860fea9c8e63d0f62e28a513c0e50d2d7171a8d4 /include/ftp/connection.hpp | |
parent | f51c3ac3f1c0cac99eb8cfe91b280d84f128cdc9 (diff) |
Added declaration of connection class with connect and execute members. Created detail and impl folder. Created one example's fileHEADmain
Diffstat (limited to 'include/ftp/connection.hpp')
-rw-r--r-- | include/ftp/connection.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/ftp/connection.hpp b/include/ftp/connection.hpp index e69de29..f0291f3 100644 --- a/include/ftp/connection.hpp +++ b/include/ftp/connection.hpp @@ -0,0 +1,30 @@ +#ifndef _CONNECTION_HPP_ +#define _CONNECTION_HPP_ + +#include <boost/asio/io_context.hpp> +#include <boost/asio/ip/tcp.hpp> +#include <ftp/error_code.hpp> +#include <ftp/handshake_params.hpp> + +namespace ftp { +namespace asio = boost::asio; + +using boost::asio::ip::tcp; + +class connection +{ + asio::io_context& ioc_; + tcp::socket cmd_socket_; + +public: + connection(asio::io_context& ioc) : ioc_(ioc), cmd_socket_(ioc_){}; + + void connect(const tcp::resolver::results_type& endpoints, const handshake_params& params); + + void connect(const tcp::resolver::results_type& endpoint, const handshake_params& params, error_code& ec); + + void execute(const std::string& command); +}; +} // namespace ftp + +#endif // !_CONNECTION_HPP_ |