public ActiveTransport(IConnectionListenerBase transport, Task acceptLoopTask, TransportConnectionManager transportConnectionManager, EndpointConfig?endpointConfig = null) { ConnectionListener = transport; AcceptLoopTask = acceptLoopTask; TransportConnectionManager = transportConnectionManager; EndpointConfig = endpointConfig; }
private void StartAcceptLoop <T>(IConnectionListener <T> connectionListener, Func <T, Task> connectionDelegate, EndpointConfig?endpointConfig) where T : BaseConnectionContext { var transportConnectionManager = new TransportConnectionManager(_serviceContext.ConnectionManager); var connectionDispatcher = new ConnectionDispatcher <T>(_serviceContext, connectionDelegate, transportConnectionManager); var acceptLoopTask = connectionDispatcher.StartAcceptingConnections(connectionListener); _transports.Add(new ActiveTransport(connectionListener, acceptLoopTask, transportConnectionManager, endpointConfig)); }
public ConnectionReference(long id, KestrelConnection connection, TransportConnectionManager transportConnectionManager) { _id = id; _weakReference = new WeakReference <KestrelConnection>(connection); ConnectionId = connection.TransportConnection.ConnectionId; _transportConnectionManager = transportConnectionManager; }
public KestrelConnection(long id, ServiceContext serviceContext, TransportConnectionManager transportConnectionManager, Func <T, Task> connectionDelegate, T connectionContext, KestrelTrace logger) : base(id, serviceContext, transportConnectionManager, logger) { _connectionDelegate = connectionDelegate; _transportConnection = connectionContext; connectionContext.Features.Set <IConnectionHeartbeatFeature>(this); connectionContext.Features.Set <IConnectionCompleteFeature>(this); connectionContext.Features.Set <IConnectionLifetimeNotificationFeature>(this); }