Beispiel #1
0
 public TFtpTransfer(ITransferChannel connection, string filename, ITransferState initialState)
 {
     ProposedOptions = TransferOptionSet.NewDefaultSet();
     Filename        = filename;
     RetryCount      = 5;
     SetState(initialState);
     Connection = connection;
     Connection.OnCommandReceived += Connection_OnCommandReceived;
     Connection.OnError           += Connection_OnError;
     Connection.Open();
     Timer = new Timer(Timer_OnTimer, null, 500, 500);
 }
Beispiel #2
0
        internal void FinishOptionNegotiation(TransferOptionSet negotiated)
        {
            NegotiatedOptions = negotiated;

            if (!NegotiatedOptions.IncludesBlockSizeOption)
            {
                NegotiatedOptions.BlockSize = TransferOptionSet.DefaultBlocksize;
            }

            if (!NegotiatedOptions.IncludesTimeoutOption)
            {
                NegotiatedOptions.Timeout = TransferOptionSet.DefaultTimeoutSecs;
            }
        }