Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More docs.

  • Loading branch information...
commit c77fcf958d8fead09f24509f258f2d91d4f48ac8 1 parent 2de0299
@davidfowl davidfowl authored
View
3  SignalR/Hubs/Hub.cs
@@ -1,5 +1,8 @@
namespace SignalR.Hubs
{
+ /// <summary>
+ /// Provides methods that communicate with SignalR connections that connected to a <see cref="Hub"/>.
+ /// </summary>
public abstract class Hub : IHub
{
/// <summary>
View
25 SignalR/Hubs/IConnected.cs
@@ -3,9 +3,34 @@
namespace SignalR.Hubs
{
+ /// <summary>
+ /// Enables connect and reconenct notificatins for a <see cref="IHub"/>
+ /// </summary>
+ /// <example>
+ /// public class MyHub : Hub, IConnected
+ /// {
+ /// public Task Connect()
+ /// {
+ /// return Clients.notifyClient("new connection established for "+ Context.ConnectionId);
+ /// }
+ ///
+ /// public Task Reconnect(IEnumerable{string} groups)
+ /// {
+ /// return Clients.notifyClient("connection re-established for "+ Context.ConnectionId);
+ /// }
+ /// }
+ /// </example>
public interface IConnected
{
+ /// <summary>
+ /// Called when a new connection is made to the <see cref="IHub"/>.
+ /// </summary>
Task Connect();
+
+ /// <summary>
+ /// Called when a connection reconencts to the <see cref="IHub"/> after a timeout.
+ /// </summary>
+ /// <param name="groups">The groups the connection are a member of.</param>
Task Reconnect(IEnumerable<string> groups);
}
}
View
20 SignalR/Hubs/IDisconnect.cs
@@ -2,8 +2,28 @@
namespace SignalR.Hubs
{
+ /// <summary>
+ /// Enables disconnect notificatins for a <see cref="IHub"/>
+ /// </summary>
+ /// <example>
+ /// public class MyHub : Hub, IDisconnect
+ /// {
+ /// public Task Disconnect()
+ /// {
+ /// // Tell everyone this connection is gone
+ /// return Clients.notifyLeave(Context.ConnectionId);
+ /// }
+ /// }
+ /// </example>
public interface IDisconnect
{
+ /// <summary>
+ /// Called when a connection is disconnected from the <see cref="IHub"/>.
+ /// </summary>
+ /// <remarks>
+ /// This method is invoked from the server side which means the only valid property on the <see cref="HubCallerContext"/>
+ /// is the connection id.
+ /// </remarks>
Task Disconnect();
}
}
View
7 SignalR/PersistentConnection.cs
@@ -88,10 +88,15 @@ private string DefaultSignal
}
/// <summary>
- /// Handles all requests for
+ /// Handles all requests for <see cref="PersistentConnection"/>s.
/// </summary>
/// <param name="context">The <see cref="HostContext"/> for the current request.</param>
/// <returns>A <see cref="Task"/> that completes when the <see cref="PersistentConnection"/> pipeline is complete.</returns>
+ /// <exception cref="T:System.InvalidOperationException">
+ /// Thrown if connection wasn't initialized.
+ /// Thrown if the transport wasn't specified.
+ /// Thrown if the connection id wasn't specified.
+ /// </exception>
public virtual Task ProcessRequestAsync(HostContext context)
{
if (!_initialized)
Please sign in to comment.
Something went wrong with that request. Please try again.