hostnameresolver Execute method
Return to Introduction  Previous page  Next page
Applies to
acHostnameResolver component.  

Declaration
procedure Execute;  

Description
The Execute method starts the thread which resolves hostnames by IP addresses specified in IPList property.  
 
To get resolved hostnames — write OnHostnameRetrieved event.  
 
To terminate hostname lookup process "manually", without awaiting finishing of the process — call Abort method.  
 
tip if AutoResolve property set to True, you don't need to call Execute method, because it will retrieve IPs automatically at once you add or specify something in IPList.  

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 IPList properties;  
Execute, Abort and ResolveCachedIP methods;  
OnHostnameRetrieved event.