// For testing
        internal KestrelServerImpl(
            IEnumerable <IConnectionListenerFactory> transportFactories,
            IEnumerable <IMultiplexedConnectionListenerFactory>?multiplexedFactories,
            ServiceContext serviceContext)
        {
            if (transportFactories == null)
            {
                throw new ArgumentNullException(nameof(transportFactories));
            }

            _transportFactory            = transportFactories.LastOrDefault();
            _multiplexedTransportFactory = multiplexedFactories?.LastOrDefault();

            if (_transportFactory == null && _multiplexedTransportFactory == null)
            {
                throw new InvalidOperationException(CoreStrings.TransportNotFound);
            }

            ServiceContext = serviceContext;

            Features         = new FeatureCollection();
            _serverAddresses = new ServerAddressesFeature();
            Features.Set <IServerAddressesFeature>(_serverAddresses);

            _transportManager = new TransportManager(_transportFactory, _multiplexedTransportFactory, ServiceContext);

            HttpCharacters.Initialize();
        }
Exemple #2
0
 public HtcServer(HtcServerOptions serverOptions)
 {
     ServerOptions     = serverOptions;
     HtcLogger         = new HtcLogger(Logger);
     ConnectionManager = new ConnectionManager(HtcLogger, ServerOptions.Limits.MaxConcurrentUpgradedConnections);
     HeartbeatManager  = new HeartbeatManager(ConnectionManager);
     Heartbeat         = new Heartbeat(new IHeartbeatHandler[] { dateHeaderValueManager, heartbeatManager }, new SystemClock(), DebuggerWrapper.Singleton, trace);
     HttpCharacters.Initialize();
 }
        // For testing
        internal KestrelServer(ITransportFactory transportFactory, ServiceContext serviceContext)
        {
            if (transportFactory == null)
            {
                throw new ArgumentNullException(nameof(transportFactory));
            }

            _transportFactory = transportFactory;
            ServiceContext    = serviceContext;

            Features         = new FeatureCollection();
            _serverAddresses = new ServerAddressesFeature();
            Features.Set(_serverAddresses);

            HttpCharacters.Initialize();
        }
Exemple #4
0
        // For testing
        internal KestrelServer(ITransportFactory transportFactory, ServiceContext serviceContext)
        {
            if (transportFactory == null)
            {
                throw new ArgumentNullException(nameof(transportFactory));
            }

            _transportFactory = transportFactory;
            ServiceContext    = serviceContext;

            var httpHeartbeatManager = new HttpHeartbeatManager(serviceContext.ConnectionManager);

            _heartbeat = new Heartbeat(
                new IHeartbeatHandler[] { serviceContext.DateHeaderValueManager, httpHeartbeatManager },
                serviceContext.SystemClock,
                DebuggerWrapper.Singleton,
                Trace);

            Features         = new FeatureCollection();
            _serverAddresses = new ServerAddressesFeature();
            Features.Set(_serverAddresses);

            HttpCharacters.Initialize();
        }
Exemple #5
0
 public HttpEngine()
 {
     HttpCharacters.Initialize();
     _listenerManager = new ListenerManager();
     _listenerManager.CreateListener(new IPEndPoint(IPAddress.Any, 80));
 }