C# Class SignalR.PersistentConnection

Inheritance: HttpTaskAsyncHandler, IGroupManager
显示文件 Open project: Icenium/SignalR

Protected Properties

Property Type Description
_ackHandler IAckHandler
_connectionIdPrefixGenerator IConnectionIdPrefixGenerator
_counters IPerformanceCounterWriter
_jsonSerializer IJsonSerializer
_newMessageBus IMessageBus
_trace ITraceManager
_transport ITransport

Private Properties

Property Type Description
GetTransport ITransport
IsNegotiationRequest bool
ProcessJsonpNegotiationRequest Task
ProcessNegotiationRequest Task

Public Methods

Method Description
Initialize ( IDependencyResolver resolver ) : void
ProcessRequestAsync ( HostContext context ) : Task

Handles all requests for PersistentConnections.

Protected Methods

Method Description
CreateConnection ( string connectionId, IEnumerable signals, IEnumerable groups ) : Connection
GetDefaultSignals ( string connectionId ) : IEnumerable

Returns the default signals for the PersistentConnection.

GetSignals ( string connectionId, IRequest request ) : IEnumerable

Returns the signals used in the PersistentConnection.

OnConnectedAsync ( IRequest request, string connectionId ) : System.Threading.Tasks.Task

Called when a new connection is made.

OnDisconnectAsync ( string connectionId ) : System.Threading.Tasks.Task

Called when a connection disconnects.

OnReceivedAsync ( IRequest request, string connectionId, string data ) : System.Threading.Tasks.Task

Called when data is received from a connection.

OnReconnectedAsync ( IRequest request, IEnumerable groups, string connectionId ) : Task

Called when a connection reconnects after a timeout.

OnRejoiningGroups ( IRequest request, IEnumerable groups, string connectionId ) : IEnumerable

Called when a connection reconnects after a timeout to determine which groups should be rejoined.

Private Methods

Method Description
GetTransport ( SignalR.HostContext context ) : ITransport
IsNegotiationRequest ( IRequest request ) : bool
ProcessJsonpNegotiationRequest ( HostContext context, object payload ) : Task
ProcessNegotiationRequest ( HostContext context ) : Task

Method Details

CreateConnection() protected method

protected CreateConnection ( string connectionId, IEnumerable signals, IEnumerable groups ) : Connection
connectionId string
signals IEnumerable
groups IEnumerable
return Connection

GetDefaultSignals() protected method

Returns the default signals for the PersistentConnection.
protected GetDefaultSignals ( string connectionId ) : IEnumerable
connectionId string The id of the incoming connection.
return IEnumerable

GetSignals() protected method

Returns the signals used in the PersistentConnection.
protected GetSignals ( string connectionId, IRequest request ) : IEnumerable
connectionId string The id of the incoming connection.
request IRequest
return IEnumerable

Initialize() public method

public Initialize ( IDependencyResolver resolver ) : void
resolver IDependencyResolver
return void

OnConnectedAsync() protected method

Called when a new connection is made.
protected OnConnectedAsync ( IRequest request, string connectionId ) : System.Threading.Tasks.Task
request IRequest The for the current connection.
connectionId string The id of the connecting client.
return System.Threading.Tasks.Task

OnDisconnectAsync() protected method

Called when a connection disconnects.
protected OnDisconnectAsync ( string connectionId ) : System.Threading.Tasks.Task
connectionId string The id of the disconnected connection.
return System.Threading.Tasks.Task

OnReceivedAsync() protected method

Called when data is received from a connection.
protected OnReceivedAsync ( IRequest request, string connectionId, string data ) : System.Threading.Tasks.Task
request IRequest The for the current connection.
connectionId string The id of the connection sending the data.
data string The payload sent to the connection.
return System.Threading.Tasks.Task

OnReconnectedAsync() protected method

Called when a connection reconnects after a timeout.
protected OnReconnectedAsync ( IRequest request, IEnumerable groups, string connectionId ) : Task
request IRequest The for the current connection.
groups IEnumerable The groups the calling connection is a part of.
connectionId string The id of the re-connecting client.
return Task

OnRejoiningGroups() protected method

Called when a connection reconnects after a timeout to determine which groups should be rejoined.
protected OnRejoiningGroups ( IRequest request, IEnumerable groups, string connectionId ) : IEnumerable
request IRequest The for the current connection.
groups IEnumerable The groups the calling connection claims to be part of.
connectionId string The id of the reconnecting client.
return IEnumerable

ProcessRequestAsync() public method

Handles all requests for PersistentConnections.
/// Thrown if connection wasn't initialized. /// Thrown if the transport wasn't specified. /// Thrown if the connection id wasn't specified. ///
public ProcessRequestAsync ( HostContext context ) : Task
context HostContext The for the current request.
return Task

Property Details

_ackHandler protected_oe property

protected IAckHandler _ackHandler
return IAckHandler

_connectionIdPrefixGenerator protected_oe property

protected IConnectionIdPrefixGenerator _connectionIdPrefixGenerator
return IConnectionIdPrefixGenerator

_counters protected_oe property

protected IPerformanceCounterWriter _counters
return IPerformanceCounterWriter

_jsonSerializer protected_oe property

protected IJsonSerializer _jsonSerializer
return IJsonSerializer

_newMessageBus protected_oe property

protected IMessageBus _newMessageBus
return IMessageBus

_trace protected_oe property

protected ITraceManager _trace
return ITraceManager

_transport protected_oe property

protected ITransport _transport
return ITransport