📄 tcpclient.h
字号:
#ifndef _TCP_CLIENT_H_#define _TCP_CLIENT_H_#include <pthread.h>class TcpClient{public: TcpClient(); virtual ~TcpClient(); bool Create(int port = 0); bool Connect(const char* ip, int port); int Send(const char* buf, int size); int Receive(char* buf, int size); void Close();protected: virtual void OnReceive() = 0; virtual void OnClose() = 0;private: bool Process(); static void* SocketThread(void* param); bool m_bQuit; int m_sock; pthread_t m_pId;private: TcpClient(const TcpClient &rhs); TcpClient& operator =(const TcpClient& rhs);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -