Fixed bug in TCP socket that caused a busy loop in the socket

multiplexer.  That caused a lock up on windows when quitting
the server with a client connected.
This commit is contained in:
crs 2004-05-04 19:37:46 +00:00
parent fdf4b2604d
commit ab0a693891
1 changed files with 7 additions and 1 deletions

View File

@ -334,16 +334,22 @@ CTCPSocket::newJob()
{
// note -- must have m_mutex locked on entry
if (m_socket == NULL || !(m_readable || m_writable)) {
if (m_socket == NULL) {
return NULL;
}
else if (!m_connected) {
assert(!m_readable);
if (!(m_readable || m_writable)) {
return NULL;
}
return new TSocketMultiplexerMethodJob<CTCPSocket>(
this, &CTCPSocket::serviceConnecting,
m_socket, m_readable, m_writable);
}
else {
if (!(m_readable || (m_writable && (m_outputBuffer.getSize() > 0)))) {
return NULL;
}
return new TSocketMultiplexerMethodJob<CTCPSocket>(
this, &CTCPSocket::serviceConnected,
m_socket, m_readable,