summaryrefslogtreecommitdiffstats
path: root/source/OSSupport/SocketThreads.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/OSSupport/SocketThreads.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/OSSupport/SocketThreads.cpp b/source/OSSupport/SocketThreads.cpp
index 13336a0c4..5058f3313 100644
--- a/source/OSSupport/SocketThreads.cpp
+++ b/source/OSSupport/SocketThreads.cpp
@@ -577,7 +577,8 @@ void cSocketThreads::cSocketThread::ReadFromSockets(fd_set * a_Read)
cCSLock Lock(m_Parent->m_CS);
for (int i = m_NumSlots - 1; i >= 0; --i)
{
- if (!FD_ISSET(m_Slots[i].m_Socket.GetSocket(), a_Read))
+ cSocket::xSocket Socket = m_Slots[i].m_Socket.GetSocket();
+ if (!cSocket::IsValidSocket(Socket) || !FD_ISSET(Socket, a_Read))
{
continue;
}
@@ -621,7 +622,8 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write)
cCSLock Lock(m_Parent->m_CS);
for (int i = m_NumSlots - 1; i >= 0; --i)
{
- if (!m_Slots[i].m_Socket.IsValid() || !FD_ISSET(m_Slots[i].m_Socket.GetSocket(), a_Write))
+ cSocket::xSocket Socket = m_Slots[i].m_Socket.GetSocket();
+ if (!cSocket::IsValidSocket(Socket) || !FD_ISSET(Socket, a_Write))
{
continue;
}