- attempt to fix WSAStartup error message on win32
This commit is contained in:
parent
c51eb0a3c4
commit
d8e28fbf90
|
@ -1379,6 +1379,10 @@ int glestMain(int argc, char** argv) {
|
||||||
disableBacktrace = true;
|
disableBacktrace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
SocketManager winSockManager;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool haveSpecialOutputCommandLineOption = false;
|
bool haveSpecialOutputCommandLineOption = false;
|
||||||
|
|
||||||
if( hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == true ||
|
if( hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == true ||
|
||||||
|
|
|
@ -92,23 +92,20 @@ public:
|
||||||
// class Socket
|
// class Socket
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
||||||
class Socket : public SimpleTaskCallbackInterface {
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
class SocketManager{
|
||||||
private:
|
public:
|
||||||
class SocketManager{
|
SocketManager();
|
||||||
public:
|
~SocketManager();
|
||||||
SocketManager();
|
};
|
||||||
~SocketManager();
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
|
||||||
static SocketManager socketManager;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class Socket : public SimpleTaskCallbackInterface {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#ifdef WIN32
|
||||||
|
SocketManager wsaManager;
|
||||||
|
#endif
|
||||||
PLATFORM_SOCKET sock;
|
PLATFORM_SOCKET sock;
|
||||||
time_t lastDebugEvent;
|
time_t lastDebugEvent;
|
||||||
static int broadcast_portno;
|
static int broadcast_portno;
|
||||||
|
|
|
@ -214,9 +214,9 @@ bool UPNP_Tools::enabledUPNP = false;
|
||||||
return acErrorBuffer;
|
return acErrorBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
Socket::SocketManager Socket::socketManager;
|
//SocketManager Socket::socketManager;
|
||||||
|
|
||||||
Socket::SocketManager::SocketManager(){
|
SocketManager::SocketManager() {
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
WORD wVersionRequested = MAKEWORD(2, 0);
|
WORD wVersionRequested = MAKEWORD(2, 0);
|
||||||
WSAStartup(wVersionRequested, &wsaData);
|
WSAStartup(wVersionRequested, &wsaData);
|
||||||
|
@ -224,7 +224,7 @@ bool UPNP_Tools::enabledUPNP = false;
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"Winsock initialized.\n");
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"Winsock initialized.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
Socket::SocketManager::~SocketManager(){
|
SocketManager::~SocketManager() {
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"Winsock cleanup complete.\n");
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"Winsock cleanup complete.\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user