- added a guard on the socket so we only shutdown if not already done so by possibly another thread.
This commit is contained in:
parent
d8092d25f6
commit
88ad6d3723
|
@ -959,6 +959,8 @@ void Socket::disconnectSocket() {
|
|||
|
||||
MutexSafeWrapper safeMutex(dataSynchAccessorRead,CODE_AT_LINE);
|
||||
MutexSafeWrapper safeMutex1(dataSynchAccessorWrite,CODE_AT_LINE);
|
||||
|
||||
if(isSocketValid() == true) {
|
||||
::shutdown(sock,2);
|
||||
#ifndef WIN32
|
||||
::close(sock);
|
||||
|
@ -967,6 +969,7 @@ void Socket::disconnectSocket() {
|
|||
::closesocket(sock);
|
||||
sock = -1;
|
||||
#endif
|
||||
}
|
||||
safeMutex.ReleaseLock();
|
||||
safeMutex1.ReleaseLock();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user