Skip to content

Commit 22e706c

Browse files
committed
pr feedback
1 parent 8c2c458 commit 22e706c

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,21 @@ public partial class HubConnection
6464
private int _serverProtocolMinorVersion;
6565

6666
/// <summary>
67-
/// Occurs when the connection is closed, either by a call to <see cref="StopAsync(CancellationToken)"/> or a connection error.
67+
/// Occurs when the connection is closed. The connection could be closed due to an error or due to either the server or client intentionally
68+
/// closing the connection without error.
6869
/// </summary>
6970
/// <remarks>
7071
/// If this event was triggered from a connection error, the <see cref="Exception"/> that occurred will be passed in as the
71-
/// sole argument to this handler. If this event was triggered from a call to <see cref="StopAsync(CancellationToken)"/>, then
72+
/// sole argument to this handler. If this event was triggered intentionally by either the client or server, then
7273
/// the argument will be <see langword="null"/>.
7374
/// </remarks>
7475
/// <example>
7576
/// The following example attaches a handler to the <see cref="Closed"/> event, and checks the provided argument to determine
7677
/// if there was an error:
7778
///
7879
/// <code>
79-
/// connection.Closed += (exception) => {
80+
/// connection.Closed += (exception) =>
81+
/// {
8082
/// if (exception == null)
8183
/// {
8284
/// Console.WriteLine("Connection closed without error.");
@@ -94,7 +96,7 @@ public partial class HubConnection
9496
internal TimeSpan TickRate { get; set; } = TimeSpan.FromSeconds(1);
9597

9698
/// <summary>
97-
/// Gets or sets the server timeout interval for the connection.
99+
/// Gets or sets the server timeout interval for the connection.
98100
/// </summary>
99101
/// <remarks>
100102
/// The client times out if it hasn't heard from the server for `this` long.
@@ -535,7 +537,7 @@ private void LaunchStreams(Dictionary<string, object> readers, CancellationToken
535537
}
536538
}
537539

538-
// this is called via reflection using the `_sendStreamItems` field
540+
// this is called via reflection using the `_sendStreamItems` field
539541
private async Task SendStreamItems<T>(string streamId, ChannelReader<T> reader, CancellationToken token)
540542
{
541543
Log.StartingStream(_logger, streamId);
@@ -874,7 +876,7 @@ private async Task HandshakeAsync(ConnectionState startingConnectionState, Cance
874876
}
875877
}
876878
}
877-
879+
878880
// shutdown if we're unable to read handshake
879881
// Ignore HubException because we throw it when we receive a handshake response with an error
880882
// And because we already have the error, we don't need to log that the handshake failed
@@ -1010,17 +1012,11 @@ private async Task ReceiveLoop(ConnectionState connectionState)
10101012
}
10111013
}
10121014

1013-
/// <summary>
1014-
/// This method is for internal framework use and should not be called by user code.
1015-
/// </summary>
10161015
public void ResetSendPing()
10171016
{
10181017
Volatile.Write(ref _nextActivationSendPing, (DateTime.UtcNow + KeepAliveInterval).Ticks);
10191018
}
10201019

1021-
/// <summary>
1022-
/// This method is for internal framework use and should not be called by user code.
1023-
/// </summary>
10241020
public void ResetTimeout()
10251021
{
10261022
Volatile.Write(ref _nextActivationServerTimeout, (DateTime.UtcNow + ServerTimeout).Ticks);
@@ -1170,7 +1166,7 @@ public void Dispose()
11701166
private class InvocationHandlerList
11711167
{
11721168
private readonly List<InvocationHandler> _invocationHandlers;
1173-
// A lazy cached copy of the handlers that doesn't change for thread safety.
1169+
// A lazy cached copy of the handlers that doesn't change for thread safety.
11741170
// Adding or removing a handler sets this to null.
11751171
private InvocationHandler[] _copiedHandlers;
11761172

src/SignalR/common/Http.Connections/src/HttpConnectionContextExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class HttpConnectionContextExtensions
1313
/// Gets the <see cref="HttpContext"/> associated with the connection, if there is one.
1414
/// </summary>
1515
/// <param name="connection">The <see cref="ConnectionContext"/> representing the connection.</param>
16-
/// <returns>The <see cref="HttpContext"/> associated with the connection, or <see langword="null"/> if the connection is not HTTP-based</returns>
16+
/// <returns>The <see cref="HttpContext"/> associated with the connection, or <see langword="null"/> if the connection is not HTTP-based.</returns>
1717
/// <remarks>
1818
/// SignalR connections can run on top of HTTP transports like WebSockets or Long Polling, or other non-HTTP transports. As a result,
1919
/// this method can sometimes return <see langword="null"/> depending on the configuration of your application.

0 commit comments

Comments
 (0)