fix for shutdown on Linux (an error message was shown on shutdown)
This commit is contained in:
parent
e004ed6964
commit
14c8df9ee4
1 changed files with 7 additions and 3 deletions
|
@ -141,17 +141,21 @@ void CSocket::Close()
|
||||||
// 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
|
#ifdef _WIN32
|
||||||
closesocket ( UdpSocket );
|
// TODO also use shutdown of the socket on Windows...
|
||||||
|
closesocket ( UdpSocket );
|
||||||
#else
|
#else
|
||||||
close ( UdpSocket );
|
shutdown ( UdpSocket, SHUT_RDWR );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CSocket::~CSocket()
|
CSocket::~CSocket()
|
||||||
{
|
{
|
||||||
|
// cleanup the socket (on Windows the WSA cleanup must also be called)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// the Windows socket must be cleanup on shutdown
|
closesocket ( UdpSocket );
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
|
#else
|
||||||
|
close ( UdpSocket );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue