//for this dnsasync object. This is not a reccomended mode of operation\r
//because it limits the app to one dns server but is kept for compatibility\r
//and special uses.\r
- addr,port:string;\r
+ addr,port:ansistring;\r
\r
overrideaf : integer;\r
\r
procedure cancel;//cancel an outstanding dns request\r
- function dnsresult:string; //get result of dnslookup as a string\r
+ function dnsresult:ansistring; //get result of dnslookup as a string\r
procedure dnsresultbin(var binip:tbinip); //get result of dnslookup as a tbinip\r
property dnsresultlist : tbiniplist read fresultlist;\r
- procedure forwardlookup(const name:string); //start forward lookup,\r
+ procedure forwardlookup(const name:ansistring); //start forward lookup,\r
//preffering ipv4\r
procedure reverselookup(const binip:tbinip); //start reverse lookup\r
- procedure customlookup(const name:string;querytype:integer); //start custom type lookup\r
+ procedure customlookup(const name:ansistring;querytype:integer); //start custom type lookup\r
\r
constructor create(aowner:tcomponent); override;\r
destructor destroy; override;\r
Src : TInetSockAddrV;\r
SrcLen : Integer;\r
fromip:tbinip;\r
- fromport:string;\r
+ fromport:ansistring;\r
begin\r
socketno := tlsocket(sender).tag;\r
//writeln('got a reply on socket number ',socketno);\r
\r
function tdnsasync.sendquery(socketno:integer;const packet:tdnspacket;len:integer):boolean;\r
var\r
- destination : string;\r
+ destination : tbinip;\r
inaddr : tinetsockaddrv;\r
trytolisten:integer;\r
begin\r
end;\r
if addr <> '' then begin\r
dnsserverids[socketno] := -1;\r
- destination := addr\r
+ destination := ipstrtobinf(addr);\r
end else begin\r
- destination := getcurrentsystemnameserver(dnsserverids[socketno]);\r
+ destination := getcurrentsystemnameserverbin(dnsserverids[socketno]);\r
end;\r
- destinations[socketno] := ipstrtobinf(destination);\r
+ destinations[socketno] := destination;\r
\r
{$ifdef ipv6}{$ifdef win32}\r
if destinations[socketno].family = AF_INET6 then if (requestaf = useaf_default) then requestaf := useaf_preferv6;\r
exit;\r
end;\r
\r
- if (overridednsserver <> '') and (addr = '') then addr := overridednsserver;\r
-\r
if overrideaf = useaf_default then begin\r
{$ifdef ipv6}\r
{$ifdef win32}if not (usewindns and (addr = '')) then{$endif}\r
inc(numsockused);\r
end;\r
{$endif}\r
+\r
for i := 0 to numsockused-1 do begin\r
asyncprocess(i);\r
end;\r
-\r
end;\r
\r
procedure tdnsasync.reverselookup;\r
begin\r
- if (overridednsserver <> '') and (addr = '') then addr := overridednsserver;\r
{$ifdef win32}\r
if usewindns and (addr = '') then begin\r
dwas := tdnswinasync.create;\r
\r
procedure tdnsasync.customlookup;\r
begin\r
- if (overridednsserver <> '') and (addr = '') then addr := overridednsserver;\r
setstate_custom(name,querytype,states[0]);\r
numsockused := 1;\r
asyncprocess(0);\r