Udostępnij za pośrednictwem


IHubPipelineModule Interface

.NET Framework 4

An IHubPipelineModule 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. Modules can be be activated by calling AddModule(IHubPipelineModule) . The combined modules added to the IHubPipeline are invoked via the IHubPipelineInvoker interface.

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

Syntax

'Declaration
Public Interface IHubPipelineModule
'Usage
Dim instance As IHubPipelineModule
public interface IHubPipelineModule
public interface class IHubPipelineModule
type IHubPipelineModule =  interface end
public interface IHubPipelineModule

The IHubPipelineModule type exposes the following members.

Methods

  Name Description
Public method BuildAuthorizeConnect Wraps 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 method BuildConnect Wraps 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 method BuildDisconnect Wraps 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 method BuildIncoming Wraps 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 method BuildOutgoing Wraps a function that invokes a client-side hub method.
Public method BuildReconnect Wraps 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 method BuildRejoiningGroups Wraps 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.

Top

See Also

Reference

Microsoft.AspNet.SignalR.Hubs Namespace