AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Indy FTP Client Read Error (TidFTP)

Indy FTP Client Read Error (TidFTP)

Ein Thema von FaNIX · begonnen am 24. Jan 2008 · letzter Beitrag vom 25. Jan 2008
Antwort Antwort
FaNIX

Registriert seit: 8. Okt 2007
36 Beiträge
 
#1

Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 12:34
Hi,

I wonder if anyone can help me with this. I have a simple FTP procedure, which downloads a single file form a FTP server.

The procedure works fine, but this is my issue:

I'm using Windows XP, and as some of you know, it has a default internal firewall, just like Vista (Security Center). Now the first time the application tries to access the FTP server, windows pops up the Firewall warning, asking to Allow this application.

[IMG]
http://img143.imageshack.us/img143/7642/indy2pf4.jpg
[/IMG]

Once i click yes, the FTP doesn't continue to download the file, it just stops, then i get the following error in delphi:

[IMG]
http://img292.imageshack.us/img292/9210/indyrn9.jpg
[/IMG]

Now if i restart the application, the download works fine, because the application was added to the windows firewall allow list. Does anyone know how to get past this error, so that it continues to transfer the file? Any help would be much appreciated.

Regards
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.754 Beiträge
 
Delphi 10.4 Sydney
 
#2

Re: Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 12:42
Hi,

can you increase the timeout value for the ftp client?
Because the ftp transfer was running into a timeout.
It took to long to add the application to firewall access list.

Best regards
Klaus
Klaus
  Mit Zitat antworten Zitat
FaNIX

Registriert seit: 8. Okt 2007
36 Beiträge
 
#3

Re: Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 12:48
Zitat von Klaus01:
Hi,

can you increase the timeout value for the ftp client?
Because the ftp transfer was running into a timeout.
It took to long to add the application to firewall access list.

Best regards
Klaus
Yes thats what I also though, and so i did the following, but it still doesn't work:

oFtp.TransferTimeout := 10000;
oftp.ReadTimeout := 10000;
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.754 Beiträge
 
Delphi 10.4 Sydney
 
#4

Re: Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 13:34
Hello again,


I'm not sure if we can catch the problem just by increasing the timeout value.
The problem is that your application does not know if it is blocked by a firewall
or the ip connection is down or something else.

A better approach might be to act on the Exception EidReplyRFCError or EidReadTimeout.
Then you start the transfer again, or you can pop up a message
that a problem has occured and the user has to check this and that.
After the message has been acknowledged the application can try to
do the transfer again.

In that case the user has enough time to allow the firewall to pass the
ftp transfer.

Bye,
Klaus
Klaus
  Mit Zitat antworten Zitat
FaNIX

Registriert seit: 8. Okt 2007
36 Beiträge
 
#5

Re: Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 14:01
Zitat von Klaus01:
Hello again,


I'm not sure if we can catch the problem just by increasing the timeout value.
The problem is that your application does not know if it is blocked by a firewall
or the ip connection is down or something else.

A better approach might be to act on the Exception EidReplayRFCError or EidReadTimeout.
Then you start the transfer again, or you can pop up a message
that a problem has occured and the user has to check this and that.
After the message has been acknowledged the application can try to
do the transfer again.

In that case the user has enough time to allow the firewall to pass the
ftp transfer.

Bye,
Klaus
mmm ok, that might work, but how do i catch the EidReplayRFCError or EidReadTimeout exceptions?
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.754 Beiträge
 
Delphi 10.4 Sydney
 
#6

Re: Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 14:07
You can use the try except things to this:

Delphi-Quellcode:
try
// do some stuff
except on e:EIdReplyRFCError do
  begin
    // do exception handling
  end;
end;
Klaus
  Mit Zitat antworten Zitat
FaNIX

Registriert seit: 8. Okt 2007
36 Beiträge
 
#7

Re: Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 14:28
Zitat von Klaus01:
You can use the try except things to this:

Delphi-Quellcode:
try
// do some stuff
except on e:EIdReplyRFCError do
  begin
    // do exception handling
  end;
end;
[DCC Error] u_CAV_Check.pas(373): E2003 Undeclared identifier: 'EIdReplyRFCError'

  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.754 Beiträge
 
Delphi 10.4 Sydney
 
#8

Re: Indy FTP Client Read Error (TidFTP)

  Alt 24. Jan 2008, 14:33
Have you added idException to your uses statement?
Klaus
  Mit Zitat antworten Zitat
FaNIX

Registriert seit: 8. Okt 2007
36 Beiträge
 
#9

Re: Indy FTP Client Read Error (TidFTP)

  Alt 25. Jan 2008, 06:40
Zitat von Klaus01:
Have you added idException to your uses statement?
Yes I have done that, but it seems that there isn't such a exception type.
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.754 Beiträge
 
Delphi 10.4 Sydney
 
#10

Re: Indy FTP Client Read Error (TidFTP)

  Alt 25. Jan 2008, 07:54
Good morning,

I've looked into the source code of indy 10, idException.pas, and you are right
EidReplyException is not definded there.

But it is defined in idReplyRFC.pas, may you have to add this unit to your uses clause.
Don't ask me the idReplyRFC is not included in idException, thats some kind of strange to me.

Cheers,
Klaus
Klaus
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:12 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz