Skip to content
Snippets Groups Projects
Commit e68bb830 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Add WSAStartup to universe.cpp to fix windows race condition

parent 0b384d2a
No related branches found
No related tags found
No related merge requests found
Pipeline #10425 passed
......@@ -36,6 +36,7 @@ int tcpListen(URI &uri) {
WSAData wsaData;
//If Win32 then load winsock
if (WSAStartup(MAKEWORD(1,1), &wsaData) != 0) {
LOG(ERROR) << "Could not initiate sockets";
return INVALID_SOCKET;
}
#endif
......
......@@ -187,6 +187,15 @@ void Universe::__start(Universe * u) {
void Universe::_run() {
timeval block;
#ifdef WIN32
WSAData wsaData;
//If Win32 then load winsock
if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) {
LOG(ERROR) << "Could not initiate sockets";
return;
}
#endif
while (active_) {
int n = _setDescriptors();
int selres = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment