Пример #1
0
 public ActiveTransport(IConnectionListenerBase transport, Task acceptLoopTask, TransportConnectionManager transportConnectionManager, EndpointConfig?endpointConfig = null)
 {
     ConnectionListener         = transport;
     AcceptLoopTask             = acceptLoopTask;
     TransportConnectionManager = transportConnectionManager;
     EndpointConfig             = endpointConfig;
 }
Пример #2
0
        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));
        }
Пример #3
0
        public ConnectionReference(long id, KestrelConnection connection, TransportConnectionManager transportConnectionManager)
        {
            _id = id;

            _weakReference = new WeakReference <KestrelConnection>(connection);
            ConnectionId   = connection.TransportConnection.ConnectionId;

            _transportConnectionManager = transportConnectionManager;
        }
Пример #4
0
 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);
 }