Exemplo n.º 1
0
 public TftpTransfer(ITransferChannel connection, String filename, ITransferState initialState)
 {
     this.ProposedOptions = TransferOptionSet.NewDefaultSet();
     this.Filename        = filename;
     this.RetryCount      = 5;
     this.timer           = new Timer(timer_OnTimer, null, 500, 500);
     this.SetState(initialState);
     this.connection = connection;
     this.connection.OnCommandReceived += new TftpCommandHandler(connection_OnCommandReceived);
     this.connection.OnError           += new TftpChannelErrorHandler(connection_OnError);
     this.connection.Open();
 }
Exemplo n.º 2
0
        internal void FinishOptionNegotiation(TransferOptionSet negotiated)
        {
            NegotiatedOptions = negotiated;
            if (!NegotiatedOptions.IncludesBlockSizeOption)
            {
                NegotiatedOptions.BlockSize = TransferOptionSet.DEFAULT_BLOCKSIZE;
            }

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