fix shutdown issue on Mac OS
This commit is contained in:
parent
3f61c348f7
commit
4fbe460041
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue