public bool Iterate()
{
Tracer.DebugFormat("InactivityMonitor[{0}] perparing for another Write Check", parent.instanceId);
if(this.pending.CompareAndSet(true, false) && this.parent.monitorStarted.Value)
{
try
{
Tracer.DebugFormat("InactivityMonitor[{0}] Write Check required sending KeepAlive.",
parent.instanceId);
KeepAliveInfo info = new KeepAliveInfo();
info.ResponseRequired = this.parent.keepAliveResponseRequired.Value;
this.parent.Oneway(info);
}
catch(IOException e)
{
this.parent.OnException(parent, e);
}
}
return this.pending.Value;
}