Don't wait in a loop. Event OnDnsLookupDone is fired after the lookup
has finished.

Arno Garrels

Nick wrote:
> But if you enter an invalid domain, or if you are not connected to the
> internet, no error is raised. I even wrote my own timer function to abort
> the process after 10 seconds but that doesn't work either.  
> 
> sIP is a global string
> 
> Button1 click
> 
>   sIP := '';
>   WSocket1.Addr:= edSite.text;
>   WSocket1.DnsLookup(edSite.text);
>   While sIP = '' do
>     Application.ProcessMessages;
>   edIP.text := sIP;
> //========
> 
> And with WsockectDone event
>   If Error<>0 then
>     sIP := 'Error retrieving'
>   else
>     sIP := WSocket1.DnsResult;
> //=========
> 
> This works 90% of the time, but if the connection dies or the domain is
> invalid (like aaazzzzbbb.com) then it hangs totaly. 
> 
> Thanks alot :-)
> Nick
-- 
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