Commit 221fac32 authored by Marc Gravell's avatar Marc Gravell

KeepAlive shouldn't bother if the conneciton is already busy

parent ea46109b
......@@ -235,6 +235,8 @@ internal void IncrementOpCount()
internal void KeepAlive()
{
if (!(physical?.IsIdle() ?? false)) return; // don't pile on if already doing something
var commandMap = Multiplexer.CommandMap;
Message msg = null;
var features = ServerEndPoint.GetFeatures();
......
......@@ -415,6 +415,8 @@ void add(string lk, string sk, string v)
Shutdown();
}
internal bool IsIdle() => _writeStatus == WriteStatus.Idle;
internal void SetIdle() => _writeStatus = WriteStatus.Idle;
internal void SetWriting() => _writeStatus = WriteStatus.Writing;
......@@ -428,6 +430,8 @@ private enum WriteStatus
Flushed,
}
/// <summary>Returns a string that represents the current object.</summary>
/// <returns>A string that represents the current object.</returns>
public override string ToString() => $"{physicalName} ({_writeStatus})";
internal static void IdentifyFailureType(Exception exception, ref ConnectionFailureType failureType)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment