Bugfix for reconnection handling.

This commit is contained in:
Gunnar Beutner 2012-04-20 16:44:32 +02:00
parent 90c4d6624b
commit bf1e07b686
2 changed files with 4 additions and 4 deletions

View File

@ -125,13 +125,13 @@ void Application::RunEventLoop(void)
int fd = socket->GetFD(); int fd = socket->GetFD();
if (FD_ISSET(fd, &writefds)) if (FD_ISSET(fd, &writefds) && socket->GetFD() != INVALID_SOCKET)
socket->OnWritable(ea); socket->OnWritable(ea);
if (FD_ISSET(fd, &readfds)) if (FD_ISSET(fd, &readfds) && socket->GetFD() != INVALID_SOCKET)
socket->OnReadable(ea); socket->OnReadable(ea);
if (FD_ISSET(fd, &exceptfds)) if (FD_ISSET(fd, &exceptfds) && socket->GetFD() != INVALID_SOCKET)
socket->OnException(ea); socket->OnException(ea);
} }
} }

View File

@ -97,7 +97,7 @@ int JsonRpcEndpoint::ClientClosedHandler(const EventArgs& ea)
ClearMethodSinks(); ClearMethodSinks();
ClearMethodSources(); ClearMethodSources();
if (CountMethodSinks() == 0) if (CountMethodSinks() == 0 && !m_ReconnectTimer)
GetEndpointManager()->UnregisterEndpoint(static_pointer_cast<Endpoint>(shared_from_this())); GetEndpointManager()->UnregisterEndpoint(static_pointer_cast<Endpoint>(shared_from_this()));
m_Client.reset(); m_Client.reset();