Definition at line 80 of file PracticalSocket.cpp. 00080 { 00081 #ifdef WIN32 00082 if (!initialized) { 00083 WORD wVersionRequested; 00084 WSADATA wsaData; 00085 00086 wVersionRequested = MAKEWORD(2, 0); // Request WinSock v2.0 00087 if (WSAStartup(wVersionRequested, &wsaData) != 0) { // Load WinSock DLL 00088 throw SocketException("Unable to load WinSock DLL"); 00089 } 00090 initialized = true; 00091 } 00092 #endif 00093 00094 // Make a new socket 00095 if ((sockDesc = socket(PF_INET, type, protocol)) < 0) { 00096 throw SocketException("Socket creation failed (socket())", true); 00097 } 00098 }
|