internal FtpServerChannel(FtpServerChannelManager channelManager, int channelId)
			: base(channelManager, channelId)
		{
			base.ReceivingBufferSize = 1024;
			_waitDataChannel = new ManualResetEventSlim(false);
			Packetizer = new FtpPacketizer();
			_pasvDataChannel = new Ftp.FtpPasvDataChannel();
		}
예제 #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();
		}