From 22e706cdc304a2ded3731736adb548861714fb10 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Tue, 26 Feb 2019 15:42:06 -0800 Subject: [PATCH] pr feedback --- .../csharp/Client.Core/src/HubConnection.cs | 22 ++++++++----------- .../src/HttpConnectionContextExtensions.cs | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs index c6cc4adafa..ee0059f6f8 100644 --- a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs +++ b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs @@ -64,11 +64,12 @@ namespace Microsoft.AspNetCore.SignalR.Client private int _serverProtocolMinorVersion; /// - /// Occurs when the connection is closed, either by a call to or a connection error. + /// Occurs when the connection is closed. The connection could be closed due to an error or due to either the server or client intentionally + /// closing the connection without error. /// /// /// If this event was triggered from a connection error, the that occurred will be passed in as the - /// sole argument to this handler. If this event was triggered from a call to , then + /// sole argument to this handler. If this event was triggered intentionally by either the client or server, then /// the argument will be . /// /// @@ -76,7 +77,8 @@ namespace Microsoft.AspNetCore.SignalR.Client /// if there was an error: /// /// - /// connection.Closed += (exception) => { + /// connection.Closed += (exception) => + /// { /// if (exception == null) /// { /// Console.WriteLine("Connection closed without error."); @@ -94,7 +96,7 @@ namespace Microsoft.AspNetCore.SignalR.Client internal TimeSpan TickRate { get; set; } = TimeSpan.FromSeconds(1); /// - /// Gets or sets the server timeout interval for the connection. + /// Gets or sets the server timeout interval for the connection. /// /// /// The client times out if it hasn't heard from the server for `this` long. @@ -535,7 +537,7 @@ namespace Microsoft.AspNetCore.SignalR.Client } } - // this is called via reflection using the `_sendStreamItems` field + // this is called via reflection using the `_sendStreamItems` field private async Task SendStreamItems(string streamId, ChannelReader reader, CancellationToken token) { Log.StartingStream(_logger, streamId); @@ -874,7 +876,7 @@ namespace Microsoft.AspNetCore.SignalR.Client } } } - + // shutdown if we're unable to read handshake // Ignore HubException because we throw it when we receive a handshake response with an error // And because we already have the error, we don't need to log that the handshake failed @@ -1010,17 +1012,11 @@ namespace Microsoft.AspNetCore.SignalR.Client } } - /// - /// This method is for internal framework use and should not be called by user code. - /// public void ResetSendPing() { Volatile.Write(ref _nextActivationSendPing, (DateTime.UtcNow + KeepAliveInterval).Ticks); } - /// - /// This method is for internal framework use and should not be called by user code. - /// public void ResetTimeout() { Volatile.Write(ref _nextActivationServerTimeout, (DateTime.UtcNow + ServerTimeout).Ticks); @@ -1170,7 +1166,7 @@ namespace Microsoft.AspNetCore.SignalR.Client private class InvocationHandlerList { private readonly List _invocationHandlers; - // A lazy cached copy of the handlers that doesn't change for thread safety. + // A lazy cached copy of the handlers that doesn't change for thread safety. // Adding or removing a handler sets this to null. private InvocationHandler[] _copiedHandlers; diff --git a/src/SignalR/common/Http.Connections/src/HttpConnectionContextExtensions.cs b/src/SignalR/common/Http.Connections/src/HttpConnectionContextExtensions.cs index 9275d0c4e2..b2f8a10cd1 100644 --- a/src/SignalR/common/Http.Connections/src/HttpConnectionContextExtensions.cs +++ b/src/SignalR/common/Http.Connections/src/HttpConnectionContextExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Http.Connections /// Gets the associated with the connection, if there is one. /// /// The representing the connection. - /// The associated with the connection, or if the connection is not HTTP-based + /// The associated with the connection, or if the connection is not HTTP-based. /// /// SignalR connections can run on top of HTTP transports like WebSockets or Long Polling, or other non-HTTP transports. As a result, /// this method can sometimes return depending on the configuration of your application.