Commit 662f60ff authored by jan.koester's avatar jan.koester
Browse files

fixed

parent 2df4ee51
Loading
Loading
Loading
Loading
+6 −3
Changes for src/event/iocp.cpp: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -415,11 +415,14 @@ namespace netplus {
		}

		for (;;) {
			// This is the correct blocking call. It waits for the g_hAcceptEvent to be signaled.
			DWORD dwResult = WSAWaitForMultipleEvents(1, &g_hAcceptEvent, FALSE, WSA_INFINITE, FALSE);

			if (SOCKET_ERROR == WSAEventSelect(_ServerSocket->fd(), g_hAcceptEvent, FD_ACCEPT)) {
			if (WSA_WAIT_FAILED == dwResult) {
				// Handle wait failure
				NetException exp;
				exp[NetException::Error] << "Error occurred while WSAEventSelect().";
				WSACloseEvent(g_hAcceptEvent);
				exp[NetException::Error] << "WSAWaitForMultipleEvents failed.";
				// ... cleanup and exit ...
				throw exp;
			}