pimpl 惯用法
现在这里有一个名为 CSocketClient 的网络通信类,定义如下:
/**
* 网络通信的基础类, SocketClient.h
* zhangyl 2017.07.11
*/
class CSocketClient
{
public:
CSocketClient();
~CSocketClient();
public:
void SetProxyWnd(HWND hProxyWnd);
bool Init(CNetProxy* pNetProxy);
bool Uninit();
int Register(const char* pszUser, const char* pszPassword);
void GuestLogin();
BOOL IsClosed();
BOOL Connect(int timeout = 3);
void AddData(int cmd, const std::string& strBuffer);
void AddData(int cmd, const char* pszBuff, int nBuffLen);
void Close();
BOOL ConnectServer(int timeout = 3);
BOOL SendLoginMsg();
BOOL RecvLoginMsg(int& nRet