I have quite an embarrassing problem. The following code simply will not create a socket on Windows; it fails and displays the error message. Could anyone briefly explain why th
You need to call WSAStartup() before any other socket functions will work on Windows (and you're supposed to call WSACleanup() when you're done).
WSAStartup()
WSACleanup()