AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Indy 9 -> Indy 10 Hilfe
Thema durchsuchen
Ansicht
Themen-Optionen

Indy 9 -> Indy 10 Hilfe

Ein Thema von Shark99 · begonnen am 23. Jan 2013
Antwort Antwort
Shark99

Registriert seit: 16. Mai 2007
403 Beiträge
 
#1

Indy 9 -> Indy 10 Hilfe

  Alt 23. Jan 2013, 20:05
Hallo!

Ich bin Dabei eine Anwendung von Indy 9 auf Indy 10 umzuschreiben.

Ist ein ziemlicher Kampf. Ich kam trotzdem einigermassen weit, aber nun stecke ich fest und mein Freund Google ist auch keine Hilfe.

Hier ist der Indy 9 Code:
Ein Thread Pool mit einer einstellbaren Anzahl von Threads wird erstellt, und diese Threads dann gestartet
(die Threads selbst führen ein Get() vom Indy HTTP Clients aus, aber das spielt hier keine Rolle).
Delphi-Quellcode:
var
  i: Integer;
begin
  // create the Pool and init it
  Pool := TIdThreadMgrPool.Create(nil);
  Pool.PoolSize := Options.RunningThreads;
  Pool.ThreadClass:= TUrlThread;

  // init threads and start them
  for i := 1 to Options.RunningThreads do
  begin
    with (Pool.GetThread as TUrlThread) do
    begin
      Index := i;
      Controler := Self;
      Priority := Options.Priority;
      Start;
    end;
  end;
Die Klasse TIdThreadMgrPool ist mit Indy 10 leider Geschichte.

Ich habe nach Ersatz gesucht, und auf dem ersten Blick scheint TIdSchedulerOfThreadPool
passend zu sein. Allerdings finde ich kein Beispiel dazu.

Wenn ich es so versuche
Delphi-Quellcode:
  TUrlThread = class(TIdThreadWithTask)

...

 var
  i: Integer;
begin
  // create the Pool and init it
  Pool := TIdSchedulerOfThreadPool.Create(nil);
  Pool.PoolSize := Options.RunningThreads;
  Pool.ThreadClass:= TUrlThread;

  // init threads and start them
  for i := 1 to Options.RunningThreads do
  Begin
    with (Pool.NewThread as TUrlThread) do
    begin
      Index := i;
      Controler := Self;
      Priority := Options.Priority;
      Start;
    end;
  end;
gibt es hier ein Problem:
Delphi-Quellcode:
procedure TIdTask.DoBeforeRun;
begin
  FBeforeRunDone := True;
  BeforeRun;
end;
und zwar access violation bei FBeforeRunDone.


Bin dankbar für jegliche Hilfe!

Geändert von Shark99 (23. Jan 2013 um 20:44 Uhr)
  Mit Zitat antworten Zitat
Antwort Antwort


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 12:29 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