public DownloaderAllocator(
     IDownloaderAgentOptions options,
     ILoggerFactory loggerFactory)
 {
     _loggerFactory = loggerFactory;
     _options       = options;
 }
Пример #2
0
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="options">下载器代理选项</param>
 /// <param name="mq">消息队列</param>
 /// <param name="downloaderAllocator">分配下载器的接口</param>
 /// <param name="networkCenter">网络中心</param>
 /// <param name="logger">日志接口</param>
 public LocalDownloaderAgent(IDownloaderAgentOptions options, IDynamicMessageQueue dmq,
                             IMessageQueue mq, IDownloaderAllocator downloaderAllocator, NetworkCenter networkCenter,
                             ILogger <LocalDownloaderAgent> logger) : base(options, dmq,
                                                                           mq, downloaderAllocator, networkCenter, logger)
 {
     // ConfigureDownloader = downloader => downloader.Logger = null;
 }
 public LocalDownloaderAgent(IDownloaderAgentOptions options,
                             IMessageQueue mq, IDownloaderAllocator downloaderAllocator, NetworkCenter networkCenter,
                             ILoggerFactory loggerFactory) : base(options,
                                                                  mq, downloaderAllocator, networkCenter, loggerFactory)
 {
     ConfigureDownloader = downloader => downloader.Logger = null;
 }
Пример #4
0
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="options">选项</param>
 /// <param name="loggerFactory">日志接口工厂</param>
 public DownloaderAllocator(
     IProxyValidator proxyValidator,
     IDownloaderAgentOptions options,
     ILoggerFactory loggerFactory)
 {
     _proxyValidator = proxyValidator;
     _loggerFactory  = loggerFactory;
     _options        = options;
 }
Пример #5
0
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="options">下载器代理选项</param>
 /// <param name="mq">消息队列</param>
 /// <param name="downloaderAllocator">分配下载器的接口</param>
 /// <param name="networkCenter">网络中心</param>
 /// <param name="logger">日志接口</param>
 protected DownloaderAgentBase(
     IDownloaderAgentOptions options,
     IMessageQueue mq,
     IDownloaderAllocator downloaderAllocator,
     NetworkCenter networkCenter,
     ILogger logger)
 {
     _mq = mq;
     _downloaderAllocator    = downloaderAllocator;
     _options                = options;
     Framework.NetworkCenter = networkCenter;
     Logger = logger;
 }
Пример #6
0
 protected DownloaderAgentBase(
     IDownloaderAgentOptions options,
     IMessageQueue mq,
     IDownloaderAllocator downloaderAllocator,
     NetworkCenter networkCenter,
     ILoggerFactory loggerFactory)
 {
     _mq = mq;
     _downloaderAllocator    = downloaderAllocator;
     _options                = options;
     Framework.NetworkCenter = networkCenter;
     Logger = loggerFactory.CreateLogger(GetType().FullName);
 }
        public NetworkCenter(
            IAdslRedialer redialer,
            IInternetDetector internetDetector,
            ILockerFactory lockerFactory,
            IDownloaderAgentOptions options,
            ILogger <NetworkCenter> logger)
        {
            _redialer         = redialer;
            _internetDetector = internetDetector;
            _lockerFactory    = lockerFactory;
            _options          = options;
            _logger           = logger;

            _sessionsFolder = Path.Combine(Framework.GlobalDirectory, "sessions");
            if (!Directory.Exists(_sessionsFolder))
            {
                Directory.CreateDirectory(_sessionsFolder);
            }
        }
Пример #8
0
 /// <summary>
 /// 构造方法
 /// </summary>
 protected AdslRedialerBase(IDownloaderAgentOptions options)
 {
     Options = options;
 }
Пример #9
0
 /// <summary>
 /// 构造方法
 /// </summary>
 public DefaultAdslRedialer(IDownloaderAgentOptions options) : base(options)
 {
 }
Пример #10
0
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="options">下载器代理选项</param>
 /// <param name="mq">消息队列</param>
 /// <param name="downloaderAllocator">分配下载器的接口</param>
 /// <param name="networkCenter">网络中心</param>
 /// <param name="logger">日志接口</param>
 public DefaultDownloaderAgent(IDownloaderAgentOptions options, IMessageQueue mq,
                               IDownloaderAllocator downloaderAllocator, NetworkCenter networkCenter, ILogger logger) : base(options, mq,
                                                                                                                             downloaderAllocator, networkCenter, logger)
 {
 }