Ejemplo n.º 1
0
        public override async Task SendKeepAlive()
        {
            if (Controller.SyncQueue.Running)
            {
                return;
            }

            try
            {
                await _ftpc.ExecuteAsync("NOOP");
            }
            catch (Exception ex)
            {
                ex.LogException();
                await Reconnect();
            }
        }
Ejemplo n.º 2
0
        public FtpClient(AccountController account)
        {
            Controller    = account;
            _certificates = new X509Certificate2Collection();

            _tKeepAlive = new Timer(async state =>
            {
                if (Controller.SyncQueue.Running || Controller.Account.KeepAliveInterval <= 0)
                {
                    return;
                }

                try
                {
                    Log.Write(l.Debug, "Sending NOOP");
                    await _ftpc.ExecuteAsync("NOOP");
                }
                catch (Exception ex)
                {
                    ex.LogException();
                    await Reconnect();
                }
            });
        }