public void WriteCheck()
{
if(this.inWrite.Value || this.failed.Value)
{
Tracer.DebugFormat("InactivityMonitor[{0}]: is in write or already failed.", instanceId);
return;
}
if(!commandSent.Value)
{
Tracer.DebugFormat("InactivityMonitor[{0}]: No Message sent since last write check. Sending a KeepAliveInfo.", instanceId);
this.asyncWriteTask.IsPending = true;
this.asyncTasks.Wakeup();
}
else
{
Tracer.DebugFormat("InactivityMonitor[{0}]: Message sent since last write check. Resetting flag.", instanceId);
}
commandSent.Value = false;
}