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 this might be? I'm incredibly confused and frustrated that something so simple is failing. Thank you.
int sock;
if( (sock = socket(AF_INET, SOCK_STREAM, 0)) < 0 )
{
printf("error opening socket");
}
EDIT: Also, printing out strerror(errno) simply shows "No error".