Skip to content

Commit 8c2c458

Browse files
committed
some little xml doc changes
1 parent 9a61275 commit 8c2c458

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,31 @@ public partial class HubConnection
6363
private ConnectionState _connectionState;
6464
private int _serverProtocolMinorVersion;
6565

66+
/// <summary>
67+
/// Occurs when the connection is closed, either by a call to <see cref="StopAsync(CancellationToken)"/> or a connection error.
68+
/// </summary>
69+
/// <remarks>
70+
/// 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+
/// the argument will be <see langword="null"/>.
73+
/// </remarks>
74+
/// <example>
75+
/// The following example attaches a handler to the <see cref="Closed"/> event, and checks the provided argument to determine
76+
/// if there was an error:
77+
///
78+
/// <code>
79+
/// connection.Closed += (exception) => {
80+
/// if (exception == null)
81+
/// {
82+
/// Console.WriteLine("Connection closed without error.");
83+
/// }
84+
/// else
85+
/// {
86+
/// Console.WriteLine($"Connection closed due to an error: {exception.Message}");
87+
/// }
88+
/// };
89+
/// </code>
90+
/// </example>
6691
public event Func<Exception, Task> Closed;
6792

6893
// internal for testing purposes
@@ -985,11 +1010,17 @@ private async Task ReceiveLoop(ConnectionState connectionState)
9851010
}
9861011
}
9871012

1013+
/// <summary>
1014+
/// This method is for internal framework use and should not be called by user code.
1015+
/// </summary>
9881016
public void ResetSendPing()
9891017
{
9901018
Volatile.Write(ref _nextActivationSendPing, (DateTime.UtcNow + KeepAliveInterval).Ticks);
9911019
}
9921020

1021+
/// <summary>
1022+
/// This method is for internal framework use and should not be called by user code.
1023+
/// </summary>
9931024
public void ResetTimeout()
9941025
{
9951026
Volatile.Write(ref _nextActivationServerTimeout, (DateTime.UtcNow + ServerTimeout).Ticks);

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ namespace Microsoft.AspNetCore.Http.Connections
99
{
1010
public static class HttpConnectionContextExtensions
1111
{
12+
/// <summary>
13+
/// Gets the <see cref="HttpContext"/> associated with the connection, if there is one.
14+
/// </summary>
15+
/// <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>
17+
/// <remarks>
18+
/// SignalR connections can run on top of HTTP transports like WebSockets or Long Polling, or other non-HTTP transports. As a result,
19+
/// this method can sometimes return <see langword="null"/> depending on the configuration of your application.
20+
/// </remarks>
1221
public static HttpContext GetHttpContext(this ConnectionContext connection)
1322
{
1423
return connection.Features.Get<IHttpContextFeature>()?.HttpContext;

src/SignalR/common/SignalR.Common/src/HubException.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ namespace Microsoft.AspNetCore.SignalR
99
/// <summary>
1010
/// The exception thrown from a hub when an error occurs.
1111
/// </summary>
12+
/// <remarks>
13+
/// Exceptions often contain sensitive information, such as connection information. Because of this, SignalR does not expose the details
14+
/// of exceptions that occur on the server to the client. However, instances of <see cref="HubException"/> <b>are</b> sent to the client.
15+
/// </remarks>
1216
[Serializable]
1317
public class HubException : Exception
1418
{

src/SignalR/server/Core/src/HubConnectionContext.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
namespace Microsoft.AspNetCore.SignalR
2121
{
22+
/// <summary>
23+
/// Encapsulates all information about an individual connection to a SignalR Hub.
24+
/// </summary>
2225
public class HubConnectionContext
2326
{
2427
private static readonly Action<object> _cancelReader = state => ((PipeReader)state).CancelPendingRead();

0 commit comments

Comments
 (0)