示例#1
0
        public SocketTransportFactory(
            IOptions <SocketTransportOptions> options,
            IApplicationLifetime applicationLifetime,
            ILoggerFactory loggerFactory)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (applicationLifetime == null)
            {
                throw new ArgumentNullException(nameof(applicationLifetime));
            }
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _options     = options.Value;
            _appLifetime = applicationLifetime;
            var logger = loggerFactory.CreateLogger("Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets");

            _trace = new SocketsTrace(logger);
        }
示例#2
0
 public UnixSocketConnectionListener(UnixDomainSocketEndPoint unixEndpoint, EndPoint endpoint, UnixSocketConnectionOptions socketConnectionOptions, SocketsTrace trace, SocketSchedulers schedulers)
 {
     _unixEndpoint            = unixEndpoint;
     _endpoint                = endpoint;
     _socketConnectionOptions = socketConnectionOptions;
     _trace      = trace;
     _schedulers = schedulers;
     _memoryPool = socketConnectionOptions.MemoryPoolFactory();
 }