SOCKET win32_socket(int af, int type, int protocol) { SOCKET s; StartSockets(); s = socket(af, type, protocol); if( s == INVALID_SOCKET || s == NULL ) errno = WSAGetLastError(); else s = OPEN_SOCKET(s); return s; }