Problem Creating Socket In Winsock
Posted on 2003-02-27
I have a routine which is attempting to make a socket connection. The part which is erroring out is as follows :
s = socket(AF_INET, SOCK_STREAM, 0);
if (s == INVALID_SOCKET)
The problem is, 100% of the time, it's coming up with an invalid socket. I've tried including both winsock.h and winsock2.h. I've tried using both AF_INET and PF_INET. I haven't seen anything out there which would cause socket creation to fail.
So I guess my question is this :
What could cause the socket() call to fail? Is there a way to see the exact problem that's causing it to fail?