Try to read some MSDN documents about Windows Sockets API or MFC class CSocket or CAsyncSocket. You should understand the the mechanism of TCP first. If you wanna use a simple way to realize your program, use MFC CSocket would be your choice. But Windows Sockets API would be better for developer. Good luck.