see how to use winsock in MSDN