Ping Cleanup (#2530)
Tidied up some comments, to make the ResetPing client behavior easier to understand. Will ping in debug mode for consistency. If this becomes a problem when debugging, developers can disable the pings manually. It's easier to fix something noisy, than try to diagnose inconsistently missing behavior.
This commit is contained in:
parent
c251e1768e
commit
e7e2ca50e9
|
|
@ -12,7 +12,6 @@ using System.Threading;
|
|||
using System.Threading.Channels;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Connections;
|
||||
using Microsoft.AspNetCore.Connections.Features;
|
||||
using Microsoft.AspNetCore.Internal;
|
||||
using Microsoft.AspNetCore.SignalR.Client.Internal;
|
||||
using Microsoft.AspNetCore.SignalR.Protocol;
|
||||
|
|
@ -556,6 +555,9 @@ namespace Microsoft.AspNetCore.SignalR.Client
|
|||
|
||||
private async Task<(bool close, Exception exception)> ProcessMessagesAsync(HubMessage message, ConnectionState connectionState)
|
||||
{
|
||||
Log.ResettingKeepAliveTimer(_logger);
|
||||
ResetTimeout();
|
||||
|
||||
InvocationRequest irq;
|
||||
switch (message)
|
||||
{
|
||||
|
|
@ -601,7 +603,7 @@ namespace Microsoft.AspNetCore.SignalR.Client
|
|||
}
|
||||
case PingMessage _:
|
||||
Log.ReceivedPing(_logger);
|
||||
// Nothing to do on receipt of a ping.
|
||||
// timeout is reset above, on receiving any message
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException($"Unexpected message type: {message.GetType().FullName}");
|
||||
|
|
@ -777,9 +779,6 @@ namespace Microsoft.AspNetCore.SignalR.Client
|
|||
}
|
||||
else if (!buffer.IsEmpty)
|
||||
{
|
||||
Log.ResettingKeepAliveTimer(_logger);
|
||||
ResetTimeout();
|
||||
|
||||
Log.ProcessingMessage(_logger, buffer.Length);
|
||||
|
||||
var close = false;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ using System.Collections.Concurrent;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO.Pipelines;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Security.Claims;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
|
|
|||
Loading…
Reference in New Issue