tcp.h
来自「c++编写的FTP服务器和客户端程序」· C头文件 代码 · 共 43 行
H
43 行
#ifndef TCP_H_
#define TCP_H_
#include <iostream>
#include <string>
class Tcp {
public:
enum DataType {
ASCII,
EBCDIC, // not implemented
IMAGE,
LOCAL // not implemented
};
~Tcp();
void setDataType(DataType type);
std::string read();
void readToStream(std::ostream& os);
void write(const std::string& buf);
void writeFromStream(std::istream& is);
int getLocalAddr();
int getLocalPort();
private:
friend class TcpFactory;
Tcp(int sock);
int sockfd;
DataType dataType;
int localAddr;
int localPort;
std::string buffer;
unsigned int pos;
bool eof;
};
#endif /*TCP_H_*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?