Hello, > the ip, if it is ip it should give me host, but it does not, it works > only with hosts
Not exacly. If you call it with IP then DNSLookupDone is just called immediatly with the IP address. Only if you pass it a hostname then a DNS lookup is done in background and OnDNSLookupDone is called a while later. --- Rgds, Wilfried http://www.mestdagh.biz Friday, July 15, 2005, 18:54, Develop ics wrote: > Hi > I've a problem with TWSocket when i want to use dnslookup with an ip > number. > If i give it a host as parameter, it resolves it, but if i give it an ip > number it does nothing, i saw in ICS's DnsLook.dpr sample project that > if i pass an ip it resolves nice > I've a list of hosts and IPs and I pass one by one, if it is host i get > the ip, if it is ip it should give me host, but it does not, it works > only with hosts > here's my sample > sock := TWSocket.Create(nil); > sock.DnsLookup(IP); > sock.OnDnsLookupDone := func_dnslookupdone; > from there i call the func_dnslookupdone: > procedure Thilo.func_dnslookupdone(Sender: TObject; ErrCode: Word); > begin > if ErrCode <> 0 then > begin > sock.Close; > sock.Free; > reloj.Interval := 5000; > msg := 'Equipo ''' + IP + ''' no conectado (5s)'; > Synchronize(logs); > end > else > begin > sock.Proto := 'tcp'; > sock.Port := '6666'; > sock.LineMode := true; > sock.LineEnd := EndOfLine; > sock.Addr := sock.DnsResult; > sock.Connect; > sock.OnSessionConnected := func_sessconnected; > end; > end; > the sock.DnsResult should give me host (when i give it a IP) but it does > nothing > What's my error? > thz -- 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