MFC TCP通讯
代码说明:
资源描述BOOL bClientRun = TRUE; CString ClientStrText; SocketClient::SocketClient(void){} SocketClient::~SocketClient(void){} CString SocketClient::GetClientString() { return ClientStrText; } void SocketClient::SetbClientRun(BOOL bBool) { bClientRun = bBool; } void ClientFun(LPVOID pArg) { while(bClientRun) { (*(Socket *)pArg).RecData(ClientStrText); } } void SocketClient::TCPClientStart(CString IP,CString Port) { TCPClient.SocketVersionInit(); TCPClient.SocketClientInit(IP,Port); hClientThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ClientFun,(LPVOID)&TCPClient,0,0); } void SocketClient::TCPClientSend(CString StrText) { TCPClient.SendData(StrText); } void SocketClient::TCPClientClose(CString StrText) { SetbClientRun(FALSE); if(hClientThre
下载说明:请别用迅雷下载,失败请重下,重下不扣分!