@@ -64,19 +64,21 @@ public partial class HubConnection
64
64
private int _serverProtocolMinorVersion ;
65
65
66
66
/// <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.
68
69
/// </summary>
69
70
/// <remarks>
70
71
/// 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
72
73
/// the argument will be <see langword="null"/>.
73
74
/// </remarks>
74
75
/// <example>
75
76
/// The following example attaches a handler to the <see cref="Closed"/> event, and checks the provided argument to determine
76
77
/// if there was an error:
77
78
///
78
79
/// <code>
79
- /// connection.Closed += (exception) => {
80
+ /// connection.Closed += (exception) =>
81
+ /// {
80
82
/// if (exception == null)
81
83
/// {
82
84
/// Console.WriteLine("Connection closed without error.");
@@ -94,7 +96,7 @@ public partial class HubConnection
94
96
internal TimeSpan TickRate { get ; set ; } = TimeSpan . FromSeconds ( 1 ) ;
95
97
96
98
/// <summary>
97
- /// Gets or sets the server timeout interval for the connection.
99
+ /// Gets or sets the server timeout interval for the connection.
98
100
/// </summary>
99
101
/// <remarks>
100
102
/// 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
535
537
}
536
538
}
537
539
538
- // this is called via reflection using the `_sendStreamItems` field
540
+ // this is called via reflection using the `_sendStreamItems` field
539
541
private async Task SendStreamItems < T > ( string streamId , ChannelReader < T > reader , CancellationToken token )
540
542
{
541
543
Log . StartingStream ( _logger , streamId ) ;
@@ -874,7 +876,7 @@ private async Task HandshakeAsync(ConnectionState startingConnectionState, Cance
874
876
}
875
877
}
876
878
}
877
-
879
+
878
880
// shutdown if we're unable to read handshake
879
881
// Ignore HubException because we throw it when we receive a handshake response with an error
880
882
// 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)
1010
1012
}
1011
1013
}
1012
1014
1013
- /// <summary>
1014
- /// This method is for internal framework use and should not be called by user code.
1015
- /// </summary>
1016
1015
public void ResetSendPing ( )
1017
1016
{
1018
1017
Volatile . Write ( ref _nextActivationSendPing , ( DateTime . UtcNow + KeepAliveInterval ) . Ticks ) ;
1019
1018
}
1020
1019
1021
- /// <summary>
1022
- /// This method is for internal framework use and should not be called by user code.
1023
- /// </summary>
1024
1020
public void ResetTimeout ( )
1025
1021
{
1026
1022
Volatile . Write ( ref _nextActivationServerTimeout , ( DateTime . UtcNow + ServerTimeout ) . Ticks ) ;
@@ -1170,7 +1166,7 @@ public void Dispose()
1170
1166
private class InvocationHandlerList
1171
1167
{
1172
1168
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.
1174
1170
// Adding or removing a handler sets this to null.
1175
1171
private InvocationHandler [ ] _copiedHandlers ;
1176
1172
0 commit comments