I am new to Winsock programming. I am more used to pure POSIX style network programming (like in Stevens' books).
I need some help with this code, which for some Microsoft reason doesn't work with Winsock 2.2 but work fine under any UNIX platform. Could someone please explain to me what the difference is? Here is the code:
#include <winsock2.h>
...
SOCKET sockfd;
...
// get the socket
sockfd = socket(PF_INET, SOCK_DGRAM, 0);
if( sockfd != 0 ) {
Bail("socket()");
exit(-1);
}