From f235772cf1781ac9e9b50e1c4c91d59666063436 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Sat, 18 Jun 2011 17:37:49 -0400 Subject: Fix WSAEWOULDBLOCK error on Windows Making a connection and then immediately accepting it is not synchronous on Windows; force the accept to block and wait for the connection we just made. --- src/threadengines/threadengine_win32.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/threadengines/threadengine_win32.cpp') diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp index 5cf20f862..674d0fab1 100644 --- a/src/threadengines/threadengine_win32.cpp +++ b/src/threadengines/threadengine_win32.cpp @@ -89,6 +89,7 @@ SocketThread::SocketThread() socklen_t sz = sizeof(addr); getsockname(listenFD, reinterpret_cast(&addr), &sz); connect(connFD, reinterpret_cast(&addr), sz); + ServerInstance->SE->Blocking(listenFD); int nfd = accept(listenFD, reinterpret_cast(&addr), &sz); if (nfd < 0) throw CoreException("Could not create ITC pipe"); -- cgit v1.2.3