Hello Ja,

> Program check list of domains with several components at once...
> putting something in woudldnt do the job.

Yes it does (not tested):

procedure TForm1.LookupBtnClick(Sender: TObject);
var
  Sock: TWSocket;
  n: integer;
bgein
  n := 0;
  while n < DomainList.Count do begin
    Sock := TWSocket.Create(nil);
    Sock.OnDnsLookupDone := SockDnsLookupDone;
    Sock.Addr := DomainList[n];
    Sock.DnsLookup(Sock.Addr);
    Inc(n);
  end;
end;

procedure SockDnsLookupDone(Sender: TObject; Error: Word);
var
  Sock: TWSocket;
begin
  Sock := TWSocket(Sender);
  if ErrCode = 0 then
    Memo1.Lines.AddStrings(Sock.DnsResultList + ' ' + Sock.Addr)
  else
    Memo1.Lines.Add('Error ' + Sock.Addr + ' ' + WSocketErrorDesc(ErrCode))
  Sock.Release;
end;

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to