You will need to change some of the includes, but most of the code, if not all, should work. Look at Microsoft's site for sockets programming examples. There are several ways to code sockets in Windows. The lowest level, like your Linux program here, is also supported. I believe most of the function calls are the same.
At first glance, aside from the headers (which kooth mentioned), the only thing that looks alien to me are the bcopy(), bzero(), etc. calls. But those can be easily swapped to memset(), memcpy(), ...
But there are a few differences:
- you have to call WSAStartup to init the socket library, and WSACleanup to finalize it.
- close is replace by closesocket
- ...
MSDN will provide you with all the require into, and point you at the headers and libs you require (the main one being winsock2.h).