hostnameresolver IPList property
Return to Introduction  Previous page  Next page
Applies to
acHostnameResolver component.  

Declaration
property IPList: TacStringList;  

Description
The IPList property used to specify/add the IP address or list of IP addresses, whose host names should be retrieved and returned in OnHostnameRetrieved event (this event should be used to get resolved hostnames).  
 
The IPList is just usual StringList and the queue for resolving of the hostnames for specified IPs in the internal thread of component. At once the host name resolved, its IP address (list item) will be automatically removed from list (queue).  
 
If AutoResolve property set to True, the component automatically start to lookup for hostnames without additional actions. If AutoResolve is False, you need to call Execute method to start the lookup.  
 
If the CacheSize is not 0 (that means that caching is enabled), the component will put resolved hostnames to the cache on each successful lookup. tip Also if you are use cache, you are able to quicly retrieve cached hostnames simply calling ResolveCachedIP method.  

Example
var  
  I: Integer;  
begin  
   // -- snip  
  acHostnameResolver1.Abort;  
  I := ConnectionList.Count;  
  if I <> 0 then  
    for I := 0 to I - 1 do  
     begin  
      acHostnameResolver1.IPList.Add(ConnectionList[I].LocalIPStr);  
      acHostnameResolver1.IPList.Add(ConnectionList[I].RemoteIPStr);  
    end;  
   acHostnameResolver1.Execute;  
   // -- snip  
end;  

See also
AutoResolve and CacheSize properties;  
Execute, Abort and ResolveCachedIP method;  
OnHostnameRetrieved event.