//release should only be called from the main thread\r
tdnswinasync=class(tthread)\r
private\r
- ipv6preffered : boolean;\r
freverse : boolean;\r
error : integer;\r
freewhendone : boolean;\r
name : string;\r
iplist : tbiniplist;\r
\r
- procedure forwardlookup(name:string;ipv6preffered:boolean);\r
+ procedure forwardlookup(name:string);\r
procedure reverselookup(ip:tbinip);\r
destructor destroy; override;\r
procedure release;\r
getnameinforesult : integer;\r
begin\r
\r
- if ip.family = AF_INET then begin\r
- sa.InAddr.family := AF_INET;\r
- sa.InAddr.port := 1;\r
- sa.InAddr.addr := ip.ip;\r
- end else {$ifdef ipv6}if ip.family = AF_INET6 then begin\r
- sa.InAddr6.sin6_family := AF_INET6;\r
- sa.InAddr6.sin6_port := 1;\r
- sa.InAddr6.sin6_addr := ip.ip6;\r
- end else{$endif} begin\r
- raise exception.create('unrecognised address family');\r
- end;\r
+ makeinaddrv(ip,'1',sa);\r
populateprocvars;\r
setlength(result,1025);\r
getnameinforesult := getnameinfo(@sa,sizeof(tinetsockaddrv),pchar(result),length(result),nil,0,0);\r
end;\r
end;\r
\r
-procedure tdnswinasync.forwardlookup(name:string;ipv6preffered:boolean);\r
+procedure tdnswinasync.forwardlookup(name:string);\r
begin\r
self.name := name;\r
- self.ipv6preffered := ipv6preffered;\r
freverse := false;\r
resume;\r
end;\r