//not seem to have any form of retry code.\r
\r
unit dnsasync;\r
-\r
+{$ifdef fpc}\r
+ {$mode delphi}\r
+{$endif}\r
interface\r
\r
uses\r
- {$ifdef win32}\r
+ {$ifdef winasyncdns}\r
dnswin,\r
{$endif}\r
lsocket,lcore,\r
\r
dnsserverids : array[0..numsock-1] of integer;\r
startts:double;\r
- {$ifdef win32}\r
+ {$ifdef winasyncdns}\r
dwas : tdnswinasync;\r
{$endif}\r
\r
procedure asyncprocess(socketno:integer);\r
procedure receivehandler(sender:tobject;error:word);\r
function sendquery(socketno:integer;const packet:tdnspacket;len:integer):boolean;\r
- {$ifdef win32}\r
+ {$ifdef winasyncdns}\r
procedure winrequestdone(sender:tobject;error:word);\r
{$endif}\r
\r
onrequestdone:tsocketevent;\r
\r
//addr and port allow the application to specify a dns server specifically\r
- //for this dnsasync object. This is not a reccomended mode of operation\r
+ //for this dnsasync object. This is not a recommended 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:ansistring;\r
procedure dnsresultbin(var binip:tbinip); //get result of dnslookup as a tbinip\r
property dnsresultlist : tbiniplist read fresultlist;\r
procedure forwardlookup(const name:ansistring); //start forward lookup,\r
- //preffering ipv4\r
+ //preferring ipv4\r
procedure reverselookup(const binip:tbinip); //start reverse lookup\r
procedure customlookup(const name:ansistring;querytype:integer); //start custom type lookup\r
\r
end;\r
end;\r
\r
- {$ifdef mswindows}\r
+ {$ifdef winasyncdns}\r
if assigned(dwas) then begin\r
dwas.release;\r
dwas := nil;\r
end;\r
destinations[socketno] := destination;\r
\r
- {$ifdef ipv6}{$ifdef win32}\r
+ {$ifdef ipv6}{$ifdef mswindows}\r
if destinations[socketno].family = AF_INET6 then if (requestaf = useaf_default) then requestaf := useaf_preferv6;\r
{$endif}{$endif}\r
\r
\r
if overrideaf = useaf_default then begin\r
{$ifdef ipv6}\r
- {$ifdef win32}if not (usewindns and (addr = '')) then{$endif}\r
+ {$ifdef mswindows}if not (usewindns and (addr = '')) then{$endif}\r
initpreferredmode;\r
{$endif}\r
requestaf := useaf;\r
requestaf := overrideaf;\r
end;\r
\r
- {$ifdef win32}\r
+ {$ifdef winasyncdns}\r
if usewindns and (addr = '') then begin\r
dwas := tdnswinasync.create;\r
dwas.onrequestdone := winrequestdone;\r
\r
procedure tdnsasync.reverselookup;\r
begin\r
- {$ifdef win32}\r
+ {$ifdef winasyncdns}\r
if usewindns and (addr = '') then begin\r
dwas := tdnswinasync.create;\r
dwas.onrequestdone := winrequestdone;\r
var\r
socketno : integer;\r
begin\r
- {$ifdef win32}\r
+ {$ifdef winasyncdns}\r
if assigned(dwas) then begin\r
dwas.release;\r
dwas := nil;\r
onrequestdone(self,0);\r
end;\r
\r
-{$ifdef win32}\r
+{$ifdef winasyncdns}\r
procedure tdnsasync.winrequestdone(sender:tobject;error:word);\r
\r
begin\r