Arno, I know waiting in a loop is not the best way, but how else can I do it? I have a list of 4 domains that I want to get the ip address for..
> ------------------------------ > > Message: 3 > Date: Wed, 21 Sep 2005 15:56:42 +0200 > From: "Arno Garrels" <[EMAIL PROTECTED]> > Subject: Re: [twsocket] Using WSocket to get ip of domain > To: "ICS support mailing" <twsocket@elists.org> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > 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