in src/Transport/InactivityMonitor.cs [170:207]
public void ReadCheck()
{
DateTime now = DateTime.Now;
TimeSpan elapsed = now - this.lastReadCheckTime;
CompositeTaskRunner taskRunner = this.asyncTasks;
if(!AllowReadCheck(elapsed))
{
Tracer.Debug("InactivityMonitor[" + instanceId + "]: A read check is not currently allowed.");
return;
}
this.lastReadCheckTime = now;
if(this.inRead.Value || this.failed.Value)
{
Tracer.DebugFormat("InactivityMonitor[{0}]: A receive is in progress or already failed.", instanceId);
return;
}
if(!commandReceived.Value)
{
Tracer.DebugFormat("InactivityMonitor[{0}]: No message received since last read check! Sending an InactivityException!", instanceId);
if(null != this.asyncErrorTask)
{
this.asyncErrorTask.IsPending = true;
}
if (this.monitorStarted.Value && taskRunner != null)
{
taskRunner.Wakeup();
}
}
else
{
commandReceived.Value = false;
}
}