public void HeartbeatReadLoop()
{
while (!m_closed)
{
if (!m_heartbeatRead.WaitOne(Heartbeat * 1000, false))
m_missedHeartbeats++;
else
m_missedHeartbeats = 0;
// Has to miss two full heartbeats to force socket close
if (m_missedHeartbeats > 1)
{
String description = "Heartbeat missing with heartbeat == " +
m_heartbeat + " seconds";
EndOfStreamException eose = new EndOfStreamException(description);
m_shutdownReport.Add(new ShutdownReportEntry(description, eose));
HandleMainLoopException(new ShutdownEventArgs(
ShutdownInitiator.Library,
0,
"End of stream",
eose));
break;
}
}
TerminateMainloop();
FinishClose();
}