From 3f61c348f74c37f571dd38e5e7d4613d0fe1dabb Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 17 Feb 2014 18:34:39 +0000 Subject: [PATCH] small fix for Windows --- src/socket.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/socket.cpp b/src/socket.cpp index 71b2d6f8..a3cd1138 100755 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -138,12 +138,12 @@ void CSocket::Init ( const quint16 iPortNumber ) void CSocket::Close() { +#ifdef _WIN32 // closesocket will cause recvfrom to return with an error because the // socket is closed -> then the thread can safely be shut down -#ifdef _WIN32 -// TODO also use shutdown of the socket on Windows... -closesocket ( UdpSocket ); + closesocket ( UdpSocket ); #else + // on OSs other than Windows, the shutdown call cancels the recvfrom shutdown ( UdpSocket, SHUT_RDWR ); #endif }