small fix for Windows
This commit is contained in:
parent
14c8df9ee4
commit
3f61c348f7
1 changed files with 3 additions and 3 deletions
|
@ -138,12 +138,12 @@ void CSocket::Init ( const quint16 iPortNumber )
|
||||||
|
|
||||||
void CSocket::Close()
|
void CSocket::Close()
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
// closesocket will cause recvfrom to return with an error because the
|
// closesocket will cause recvfrom to return with an error because the
|
||||||
// socket is closed -> then the thread can safely be shut down
|
// socket is closed -> then the thread can safely be shut down
|
||||||
#ifdef _WIN32
|
closesocket ( UdpSocket );
|
||||||
// TODO also use shutdown of the socket on Windows...
|
|
||||||
closesocket ( UdpSocket );
|
|
||||||
#else
|
#else
|
||||||
|
// on OSs other than Windows, the shutdown call cancels the recvfrom
|
||||||
shutdown ( UdpSocket, SHUT_RDWR );
|
shutdown ( UdpSocket, SHUT_RDWR );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue