From 4fbe4600416b72531d580560e9303c30a2f8e821 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Tue, 18 Feb 2014 19:36:09 +0000 Subject: [PATCH] fix shutdown issue on Mac OS --- src/socket.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/socket.cpp b/src/socket.cpp index a3cd1138..21560240 100755 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -142,8 +142,11 @@ void CSocket::Close() // closesocket will cause recvfrom to return with an error because the // socket is closed -> then the thread can safely be shut down closesocket ( UdpSocket ); +#elif defined ( __APPLE__ ) || defined ( __MACOSX ) + // on Mac the general close has the same effect as closesocket on Windows + close ( UdpSocket ); #else - // on OSs other than Windows, the shutdown call cancels the recvfrom + // on Linux the shutdown call cancels the recvfrom shutdown ( UdpSocket, SHUT_RDWR ); #endif }