mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
- 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;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
SocketManager winSockManager;
|
||||
#endif
|
||||
|
||||
bool haveSpecialOutputCommandLineOption = false;
|
||||
|
||||
if( hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == true ||
|
||||
|
@ -92,23 +92,20 @@ public:
|
||||
// class Socket
|
||||
// =====================================================
|
||||
|
||||
class Socket : public SimpleTaskCallbackInterface {
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
private:
|
||||
class SocketManager{
|
||||
public:
|
||||
SocketManager();
|
||||
~SocketManager();
|
||||
};
|
||||
|
||||
protected:
|
||||
static SocketManager socketManager;
|
||||
|
||||
#endif
|
||||
|
||||
class Socket : public SimpleTaskCallbackInterface {
|
||||
|
||||
protected:
|
||||
#ifdef WIN32
|
||||
SocketManager wsaManager;
|
||||
#endif
|
||||
PLATFORM_SOCKET sock;
|
||||
time_t lastDebugEvent;
|
||||
static int broadcast_portno;
|
||||
|
@ -214,9 +214,9 @@ bool UPNP_Tools::enabledUPNP = false;
|
||||
return acErrorBuffer;
|
||||
}
|
||||
|
||||
Socket::SocketManager Socket::socketManager;
|
||||
//SocketManager Socket::socketManager;
|
||||
|
||||
Socket::SocketManager::SocketManager(){
|
||||
SocketManager::SocketManager() {
|
||||
WSADATA wsaData;
|
||||
WORD wVersionRequested = MAKEWORD(2, 0);
|
||||
WSAStartup(wVersionRequested, &wsaData);
|
||||
@ -224,7 +224,7 @@ bool UPNP_Tools::enabledUPNP = false;
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"Winsock initialized.\n");
|
||||
}
|
||||
|
||||
Socket::SocketManager::~SocketManager(){
|
||||
SocketManager::~SocketManager() {
|
||||
WSACleanup();
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"Winsock cleanup complete.\n");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user