![]() |
InitializeSockets() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: SpoofBase.h |
static BOOL InitializeSockets( BOOL bMultiThreaded=FALSE, int iNumberOfThreads=0);
Initialize the sockets
//To avoid double initialize if (m_Initialized) return TRUE; try { //Initialize the sockets WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD( 2, 2 ); err = WSAStartup( wVersionRequested, &wsaData ); if (err!=0) /* Tell the user that we could not find a usable */ /* WinSock DLL. */ return FALSE; /* Confirm that the WinSock DLL supports 2.2.*/ /* Note that if the DLL supports versions greater */ /* than 2.2 in addition to 2.2, it will still return */ /* 2.2 in wVersion since that is the version we */ /* requested. */ if (LOBYTE(wsaData.wVersion)!=2 || HIBYTE(wsaData.wVersion)!=2) { /* Tell the user that we could not find a usable */ /* WinSock DLL. */ WSACleanup(); return FALSE; } //Save the threading information m_bMultiThreaded=bMultiThreaded; m_NumberOfThreads=iNumberOfThreads; //And we are initialized m_Initialized=TRUE; return TRUE; } catch (...) { return FALSE; }
![]() |
Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 24 Apr 2001. |