Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
#3
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennanConroy committed Aug 2, 2018
1 parent 9e5311e commit 41e3ef7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Microsoft.AspNetCore.SignalR.Core/HubConnectionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private void CheckClientTimeout()
{
if (!_receivedMessageThisInterval)
{
Log.ClientTimeout(_logger);
Log.ClientTimeout(_logger, TimeSpan.FromTicks(_clientTimeoutInterval));
Abort();
}

Expand Down Expand Up @@ -561,8 +561,8 @@ private static class Log
private static readonly Action<ILogger, Exception> _abortFailed =
LoggerMessage.Define(LogLevel.Trace, new EventId(8, "AbortFailed"), "Abort callback failed.");

private static readonly Action<ILogger, Exception> _clientTimeout =
LoggerMessage.Define(LogLevel.Debug, new EventId(9, "ClientTimeout"), "Client has not sent a message within the timeout period. Closing connection.");
private static readonly Action<ILogger, int, Exception> _clientTimeout =
LoggerMessage.Define<int>(LogLevel.Debug, new EventId(9, "ClientTimeout"), "Client timeout ({ClientTimeout}ms) elapsed without receiving a message from the client. Closing connection.");

public static void HandshakeComplete(ILogger logger, string hubProtocol)
{
Expand Down Expand Up @@ -604,9 +604,9 @@ public static void AbortFailed(ILogger logger, Exception exception)
_abortFailed(logger, exception);
}

public static void ClientTimeout(ILogger logger)
public static void ClientTimeout(ILogger logger, TimeSpan timeout)
{
_clientTimeout(logger, null);
_clientTimeout(logger, (int)timeout.TotalMilliseconds, null);
}
}
}
Expand Down

0 comments on commit 41e3ef7

Please sign in to comment.