Delphi Service Application crashing after several hours (wodSFTP / wodSFTP.NET / wodSFTPdll)
Hi,
I'm using wodSFTP (imported as a Type Library) in a Win32 Service Application developed in Delphi XE2.
The Application connects to an SFTP Server every 15 minutes and checks for new files. If there are any, it downloads them and then deletes them from the server.
This works fine for a couple of hours, but then I get an EOLEException saying the Component was busy and got disconnected. After that the service hangs and needs to be restarted.
The wodSFTP-Component is initialized like this:
sftp.Connect;
sftp.LicenseKey := 'MyLicenseKey';
sftp.Hostname := 'MyServer';
sftp.Login := 'MyUsername';
sftp.Port := 22;
sftp.Password := 'MyPassword';
sftp.Blocking := true;
sftp.Authentication := authPassword;
sftp.ProxyType := ProxyNone;
The code that executes every 15 minutes looks like this
try
sftp.Connect1;
sftp.RemotePath := '/files';
sftp.LocalPath := 'c:\temp\download\';
sftp.GetFiles(sftp.LocalPath, sftp.RemotePath, 1);
RemoveFilesFromServer; // Deletes only the downloaded files
sftp.Disconnect1;
except
on ex: Exception do
begin
fLastError := Now;
bugreport := CreateBugReport(etNormal, ex);
AddLog(bugreport);
end;
end;
If another error occurs (e.g. wrong authentication) the error is logged, but the service continues, which is the desired behaviour.
Why is the behaviour different after the 'Component was busy...'-error?
Best Regards,
Nils
EDIT: The Exception occurs during the sftp.GetFiles call.
Complete thread:
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-05, 20:20
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-05, 23:21
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-06, 09:31
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-06, 12:48
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-06, 13:30
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-06, 19:55
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-07, 14:06
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-07, 19:26
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-11, 20:31
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-12, 09:45
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-12, 10:08
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-12, 09:45
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-11, 20:31
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-07, 19:26
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-07, 14:06
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-06, 19:55
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-06, 13:30
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-06, 12:48
- Delphi Service Application crashing after several hours - Gloegg, 2014-08-06, 09:31
- Delphi Service Application crashing after several hours - wodSupport, 2014-08-05, 23:21