Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Idhttp array Probelm (https://www.delphipraxis.net/111396-idhttp-array-probelm.html)

gandime 2. Apr 2008 20:15


Idhttp array Probelm
 
Hi,
ich möchte ein Idhttp arrayerstellen aber das will mal wieder nicht so richtig ;-) was mache ich flache?
Delphi-Quellcode:
var
  ht: array [1..100] of TIdHTTP;
begin
  for I := 1 to 100 do
  begin
    ht_status[i]:='n';
    ht[i]:=Tidhttp.Create(nil);
    ht[i].HandleRedirects:=True;
    ht[i].RedirectMaximum:=15;
    ht[i].Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
    ht[i].ReadTimeout:=60000;
    ht[i].IOHandler:=IdSSLIOHandlerSocketOpenSSL1;
    ht[1].Post('https://abc.de',sl);// fehler bei i=2
  end;
Fehler:
Delphi-Quellcode:
Erste Gelegenheit für Exception bei $755D3843. Exception-Klasse EIdNotASocket mit Meldung 'Socket Error # 10038
Socket operation on non-socket.'. Prozess Project1.exe (2824)
mfg
gandime

DataCool 3. Apr 2008 00:48

Re: Idhttp array Probelm
 
Hi,

wo ist den Dein Post-Parameter "sl" deklariert ?

Wozu ein Array mit 100 IdHttp ?

Entweder 100 Threads parallel erzeugen mit jeweils einem eigenen TIdHttp

oder 1 TIdHttp das hintereinander 100 Anfragen.

Was hast Du vor ?

Greetz Data

SirThornberry 3. Apr 2008 07:15

Re: Idhttp array Probelm
 
den fehler würde ich daran vermuten das du das ssl-modul mehrfach verwendest. Aber wie bereits erwähnt macht das was du da gepostet hast keinen sinn. Warum 100 TIdHttp erzeugen wenn du immer nur eins gleichzeitig verwendest.


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:52 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