I encapsulate the example in Windows network to a class. This makes it easy for beginners to expand this class after the initiator will continue to be in-depth, and it is not bad to make Lib, or DLL is not bad. In fact, there is nothing else to let beginners. Understand this is the most basic TCP-connected server program, just like Windows's basic framework, with this you can continue to learn a function of a certain agreement, then constantly enrich this framework is confused. Is a network program how to implement a network program is currently the most widely used application based on the TCP / IP protocol, IPX is also very extensive on the online game, and P2P, etc. in the beginner stage, like many articles on the Internet. Said, there should be an overall understanding of ISO / OSII and then contact us for a layer of peaceful network programs such as QQ is a typical message transmission function that utilizes UDP implementation, but maybe a program is not only adopted. An agreement is achieved, often a variety of protocols composite. When you come here, you can find a textbook to get a textbook to learn. In fact, there is a lot of teaching materials on the network. There is no need to spend money to buy BOOL BRECVONLY = FALSE; DWORD WINAPI ClientThread (LPVOID LPPARAM) {socket Sock = (socket) LPParam; char SZBuff [4096]; int RET, NLEFT, IDX; While (1) {RET = Recv (SOCK, SZBUFF, 4096, 0); if (RET == 0) Break; SZBuff [Ret] = '/ 0'; IF ! BRECVONLY) {NLEFT = RET; IDX = 0; While (NLEFT> 0) {RET = Send (Sock, & SZBuff [Idx], NLEFT, 0); if (RET == 0) Break; NLEFT - = Ret; IDX = ret; port = 3496; // Initlize port} // destructor -unconstract funcDxCustomTCP :: ~ DxCustomTCP () {} // initialize TCP connection -Init TCP Connectvoid DxCustomTCP :: DxInitCreateTCP () {WSADATA wsd; SOCKET sListen, sClient; int Iaddrsize; handle hthread = null; dword dwthreadid = null; struct sockaddr_in local, client;