Einzelnen Beitrag anzeigen

Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#1

IdHTTP im Thread

  Alt 14. Okt 2016, 19:13
Hallo ich habe wieder mal ein kleines Thread Thema, dachte mittlerweile habe ich Threads unter Kontrolle.

Delphi-Quellcode:
        IdHTTP := TIdHTTP.Create;
        try
            c := GetTickCount;
            IdHTTP.Head('http://www.myside.com/startseite/');
            if IdHTTP.ResponseCode <> 200 then Status := 0;
        except
            on e : Exception do begin
                Status := 0;
            end;
        end;
        IdHTTP.Free;
das läuft im Execute des threads im Interval von 5 Sekunden ... im IdHTTP.Head bekomme ich immer wieder mal Exceptions

Die Exception kommt dann immmer im

Delphi-Quellcode:
procedure TIdBuffer.Write(const ABytes: TIdBytes; const ALength, AOffset : Integer;
  const ADestIndex: Integer = -1);
var
  LByteLength: Integer;
  LIndex : Integer;
begin
  LByteLength := IndyLength(ABytes, ALength, AOffset);
  if LByteLength = 0 then begin
    Exit;
  end;
  LIndex := IndyMax(ADestIndex, 0);
  CheckAdd(LByteLength, LIndex);
  if Size = 0 then begin
    FHeadIndex := 0;
    if ADestIndex < 0 then
    begin
      FBytes := ToBytes(ABytes, LByteLength, AOffset); << Hier Exception
      FSize := LByteLength;
    end else
Im Hauptthread habe ich noch ein IsMultiThread := TRUE ... auch wenn ich das theoretisch nicht brauchen sollte wenn ich TThread verwende ...

Verwende Delpho2007 und müsste Indy 10.6.2 sein (ISt sicher nicht die akutellste ... aber sollte ja trotzdem so was einfaches funken)
Glaube ich habe noch irgend einen ganz primitiven Denkfehler ...

Kann mir noch wer nen Tipp geben?
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat