Ejemplo n.º 1
0
        public FtpServer(Configuration.FtpServerOptionElement configuration) : base(21)
        {
            //不要在构造函数检测参数是否空,应该在OnStart方法中检测
            _configuration = configuration;

            _pasvDataChannelPool = new ObjectPool <FtpPasvDataChannel>(
                () =>
            {
                var channel = new FtpPasvDataChannel();
                channel.StartListener();
                return(channel);
            }, channel => channel.StopListener());

            _commandExecutor = new FtpCommandExecutor();
        }
Ejemplo n.º 2
0
		public FtpServer(Configuration.FtpServerOptionElement configuration)
			: base(21)
		{
			//不要在构造函数检测参数是否空,应该在OnStart方法中检测
			_configuration = configuration;

			_pasvDataChannelPool = new ObjectPool<FtpPasvDataChannel>(
				() =>
				{
					var channel = new FtpPasvDataChannel();
					channel.StartListener();
					return channel;
				}, channel => channel.StopListener());

			_commandExecutor = new FtpCommandExecutor();
		}