-#include <iostream>
#include "platform_api.h"
+#include "socket.h"
+#include <iostream>
#include <msp/core/systemerror.h>
#include <msp/io/handle_private.h>
#include "sockaddr_private.h"
-#include "socket.h"
#include "socket_private.h"
using namespace std;
}
};
-WinSockHelper wsh;
+unique_ptr<WinSockHelper> wsh;
}
void Socket::platform_init()
{
+ if(!wsh)
+ wsh = make_unique<WinSockHelper>();
*priv->event = CreateEvent(0, false, false, 0);
}