Ejemplo n.º 1
0
        public override void OnTimer()
        {
            if (!m_timer.IsTimeout())
            {
                return;
            }

            TFtpTrace.Trace("Network timeout.", Context);
            m_timer.Restart();

            if (m_retriesUsed++ >= Context.RetryCount)
            {
                TFtpTransferError error = new TimeoutError(Context.RetryTimeout, Context.RetryCount);
                Context.SetState(new ReceivedError(error));
            }
            else
            {
                HandleTimeout();
            }
        }
Ejemplo n.º 2
0
 public override void OnStateEnter()
 {
     TFtpTrace.Trace($"Received error: {m_error}", Context);
     Context.RaiseOnError(m_error);
     Context.SetState(new Closed());
 }