Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Jan : IdFTP: Connect doesn't work after disconnect
| Subject: | IdFTP: Connect doesn't work after disconnect |
| Posted by: | "A. Stroebel" (an..@ascomp.de) |
| Date: | Mon, 1 Jan 2007 01:08:17 |
Hello,
first of all I would wish all of you a happy new year!
With IdFTP I have the following problem: the first connect succeeds, if I
disconnect my internet connection and reconnect and call "IdFTP.Connect"
again, it doesn't work. If I retry IdFTP.Connect it works fine.
label FTPRestart:
FTPError := false;
try
IdFTP.Connect;
except
if Application.MessageBox('Retry?, 'Connect failed', 36 OR
MB_SYSTEMMODAL) = 6 then
FTPError := true
else
exit;
end;
if FTPError then
GoTo FTPRestart;
try
IdFTP.Put(MyFile, FTPFileName, false);
except
if Application.MessageBox('Retry?, 'Upload failed', 36 OR MB_SYSTEMMODAL)
= 6 then
FTPError := true
else
exit;
end;
if FTPError then
GoTo FTPRestart;
To test: connect, upload, disconnect your internet connection manually. Now
"Upload failed" will be shown, retry with "Yes". Now "Connect failed" will
be shown, retry with "Yes" and now it will work!
But why? It should work after retrying the first time!
Best regards,
Andy