m_reactor.addEventHandler(m_socket, NObserver<MyClass, ReadableNotification>(*this, MyClass::OnReadable));
void OnReadable(const AutoPtr<ReadableNotification>& pNf)
long waitingBytes = m_socket.available();
if (waitingBytes != 0)
// do stuff
I don't know anything about Poco, but in general, select() does not report any differentiation between a readable socket and a disconnected socket. It reports a socket is readable when closed/lost/terminated
marlondean wrote:So if I keep on getting readablenotifications on the client after the server closed, how do I see that the server is actually gone? I can see that m_socket.available(); returns 0, so can I assume that if I get a readablenotifications and m_socket.available(); returns 0 that the server has gone missing (either due to a crash or closing or simply network loss)?
Users browsing this forum: No registered users and 0 guests