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