?? tcp.h
字號:
#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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -