コード例 #1
0
        public DefaultHttpHandler(IServerLoader serverLoader, ILogger logger = null)
        {
            _pipes        = new List <DefaultPipe>();
            _serverLoader = Throw.IfNull(() => serverLoader);

            _logger = logger;
        }
コード例 #2
0
        public StandardLocalSocks5Handler(IServerLoader serverLoader, ILogger logger = null)
        {
            _pipes        = new List <DefaultPipe>();
            _serverLoader = Throw.IfNull(() => serverLoader);

            _logger = logger;
        }
コード例 #3
0
        public HttpProxySever(HttpProxySeverConfig httpProxySeverConfig, IServerLoader serverLoader, ILogger logger = null)
        {
            _config       = Throw.IfNull(() => httpProxySeverConfig);
            _serverLoader = Throw.IfNull(() => serverLoader);
            _logger       = logger;
            ServerConfig serverConfig = new ServerConfig()
            {
                BindPoint    = _config.GetBindPoint(),
                MaxNumClient = Defaults.MaxNumClient
            };

            _tcpServer = new TcpServer(serverConfig, logger);
        }
コード例 #4
0
        public LocalServer(LocalServerConfig localServerConfig, IServerLoader serverLoader, ILogger logger = null)
        {
            _localServerConfig = Throw.IfNull(() => localServerConfig);
            _serverLoader      = Throw.IfNull(() => serverLoader);
            _logger            = logger;

            ServerConfig serverConfig = new ServerConfig()
            {
                BindPoint    = _localServerConfig.GetBindPoint(),
                MaxNumClient = Defaults.MaxNumClient
            };

            _tcpServer = new TcpServer(serverConfig, _logger);
            _udpServer = new UdpServer(serverConfig, _logger);
        }
コード例 #5
0
ファイル: HostingEngine.cs プロジェクト: Guruanth/Hosting
        private void EnsureServerFactory(HostingContext context)
        {
            if (context.ServerFactory != null)
            {
                return;
            }

            if (_serverLoader == null)
            {
                _serverLoader = context.ApplicationServices.GetRequiredService<IServerLoader>();
            }

            context.ServerFactory = _serverLoader.LoadServerFactory(context.ServerFactoryLocation);
        }
コード例 #6
0
 public TestServerLoader(IServiceProvider services)
 {
     _wrappedServerLoader = new ServerLoader(services);
 }