Export (0) Print
Expand All

HubPipelineModule Class

.NET Framework 4
.NET Framework 4

Common base class to simplify the implementation of IHubPipelineModules. A module can intercept and customize various stages of hub processing such as connecting, reconnecting, disconnecting, invoking server-side hub methods, invoking client-side hub methods, authorizing hub clients and rejoining hub groups. A module can be activated by calling AddModule(IHubPipelineModule) . The combined modules added to the IHubPipeline are invoked via the IHubPipelineInvoker interface.

System.Object
  Microsoft.AspNet.SignalR.Hubs.HubPipelineModule
    Microsoft.AspNet.SignalR.Hubs.AuthorizeModule

Namespace:  Microsoft.AspNet.SignalR.Hubs
Assembly:  Microsoft.AspNet.SignalR.Core (in Microsoft.AspNet.SignalR.Core.dll)

public abstract class HubPipelineModule : IHubPipelineModule

The HubPipelineModule type exposes the following members.

  NameDescription
Public methodBuildAuthorizeConnectWraps a function to be called before a client subscribes to signals belonging to the hub described by the HubDescriptor . By default, the AuthorizeModule will look for attributes on the IHub to help determine if the client is authorized to subscribe to method invocations for the described hub. The function returns true if the client is authorized to subscribe to client-side hub method invocations; false, otherwise.
Public methodBuildConnectWraps a function that is called when a client connects to the HubDispatcher for each IHub the client connects to. By default, this results in the IHub 's OnConnected method being invoked.
Public methodBuildDisconnectWraps a function that is called when a client disconnects from the HubDispatcher for each IHub the client was connected to. By default, this results in the IHub 's OnDisconnected method being invoked.
Public methodBuildIncomingWraps a function that invokes a server-side hub method. Even if a client has not been authorized to connect to a hub, it will still be authorized to invoke server-side methods on that hub unless it is prevented in BuildIncoming(Func<IHubIncomingInvokerContext, Task<Object>>) by not executing the invoke parameter.
Public methodBuildOutgoingWraps a function that invokes a client-side hub method.
Public methodBuildReconnectWraps a function that is called when a client reconnects to the HubDispatcher for each IHub the client connects to. By default, this results in the IHub 's OnReconnected method being invoked.
Public methodBuildRejoiningGroupsWraps a function that determines which of the groups belonging to the hub described by the HubDescriptor the client should be allowed to rejoin. By default, clients that are reconnecting to the server will be removed from all groups they may have previously been a member of, because untrusted clients may claim to be a member of groups they were never authorized to join.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnAfterConnectThis method is called after the connect components of any modules added later to the IHubPipeline are executed and after OnConnected() is executed, if at all.
Protected methodOnAfterDisconnectThis method is called after the disconnect components of any modules added later to the IHubPipeline are executed and after OnDisconnected() is executed, if at all.
Protected methodOnAfterIncomingThis method is called after the incoming components of any modules added later to the IHubPipeline and the server-side hub method have completed execution.
Protected methodOnAfterOutgoingThis method is called after the outgoing components of any modules added later to the IHubPipeline are executed. This does not mean that all the clients have received the hub method invocation, but it does indicate a hub invocation message has successfully been published to a message bus.
Protected methodOnAfterReconnectThis method is called after the reconnect components of any modules added later to the IHubPipeline are executed and after OnReconnected() is executed, if at all.
Protected methodOnBeforeAuthorizeConnectThis method is called before the AuthorizeConnect components of any modules added later to the IHubPipeline are executed. If this returns false, then those later-added modules will not run and the client will not be allowed to subscribe to client-side invocations of methods belonging to the hub defined by the HubDescriptor .
Protected methodOnBeforeConnectThis method is called before the connect components of any modules added later to the IHubPipeline are executed. If this returns false, then those later-added modules and the OnConnected() method will not be run.
Protected methodOnBeforeDisconnectThis method is called before the disconnect components of any modules added later to the IHubPipeline are executed. If this returns false, then those later-added modules and the OnDisconnected() method will not be run.
Protected methodOnBeforeIncomingThis method is called before the incoming components of any modules added later to the IHubPipeline are executed. If this returns false, then those later-added modules and the server-side hub method invocation will not be executed. Even if a client has not been authorized to connect to a hub, it will still be authorized to invoke server-side methods on that hub unless it is prevented in BuildIncoming(Func<IHubIncomingInvokerContext, Task<Object>>) by not executing the invoke parameter or prevented in OnBeforeIncoming(IHubIncomingInvokerContext) by returning false.
Protected methodOnBeforeOutgoingThis method is called before the outgoing components of any modules added later to the IHubPipeline are executed. If this returns false, then those later-added modules and the client-side hub method invocation(s) will not be executed.
Protected methodOnBeforeReconnectThis method is called before the reconnect components of any modules added later to the IHubPipeline are executed. If this returns false, then those later-added modules and the OnReconnected() method will not be run.
Protected methodOnIncomingErrorThis is called when an uncaught exception is thrown by a server-side hub method or the incoming component of a module added later to the IHubPipeline . Observing the exception using this method will not prevent it from bubbling up to other modules.
Public methodToString (Inherited from Object.)
Top

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft