Autor Beitrag
woully
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78



BeitragVerfasst: Do 08.10.09 14:14 
Hallo zusammen,

ich will mir Dateien aus dem Internet herunterladen mit der TidHttp Komponente.
Dazu verwende ich einen Filestream und die Get Funktion.
Funktioniert auch ganz gut.

Nur, wenn ich wärend dem download das Netzwerkkabel ziehe, um eine Netzwekzunterbrechung zu simulieren, kommt die Funktion Get nicht mehr zurück, und mein Program friert ein.

In dem forum habe ich nichts in der Art gefunden.
Ich bin einsteiger in der Entwicklung mit Http Komponenten, und komme einfach nicht weiter.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Hier mal mein Quellcode.

Pocedure ....
var
  fs        : TfileStream;
  Http      : TidHTTP;
begin

  Try
    HTTP := TIdHTTP.Create(nil);  

    Try
      FS := TFileStream.Create(strValue,fmCreate);

      try
        Http.Get(strUrl,FS);   //Hier bleibt das programm hängen
      except
        on E : Exception do showmessage(e.Message);
      end;
      finally
        FS.Free;
      end;
  finally
    FreeandNil(HTTP);
    HTTP := nil;
  end;
end;


Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Moderiert von user profile iconNarses: Topic aus Windows API verschoben am Do 08.10.2009 um 14:27
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Do 08.10.09 15:16 
Such mal nach Timeout.
Entweder, das ist ein Parameter von Get(), oder eine Eigenschaft von IdHTTP die man einstellen kann.

_________________
PROGRAMMER: A device for converting coffee into software.
woully Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78



BeitragVerfasst: Do 08.10.09 15:30 
hi,

klar.
Readtimeout setzen un schon funktionniert's ....

Danke