⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.h

📁 c++编写的FTP服务器和客户端程序
💻 H
字号:
#ifndef CLIENT_H_
#define CLIENT_H_

#include "directory.h"
#include "tcpfactory.h"

class Client {
public:
	Client(const std::string& addr, int port = 21);
	~Client();

	int user(const std::string& username = "anonymous");
	int pass(const std::string& password);
	int cwd(const std::string& path);
	int cdup();
	int quit();
	int port(int port);
	int pasv();
	int type(Tcp::DataType type);
	int stor(const std::string& filename);
	int retr(const std::string& filename);
	int appe(const std::string& filename);
	int list(const std::string& path = "");
	int pwd(Directory& dir);
	int abor();
	int syst();
	int help(const std::string& command = "");

	bool connect(Client* host);
	bool transfer(Client* host, const std::string& filename);

private:
	int getReply(std::string& reply);
	void openDataConnection();

	Tcp* pi;
	Tcp* data;
	TcpFactory dtp;
	bool passive;
	Tcp::DataType dataType;
};

#endif /*CLIENT_H_*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -