//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 mswindows}\r
+ {$ifdef winasyncdns}\r
dnswin,\r
{$endif}\r
lsocket,lcore,\r
\r
dnsserverids : array[0..numsock-1] of integer;\r
startts:double;\r
- {$ifdef mswindows}\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 mswindows}\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
requestaf := overrideaf;\r
end;\r
\r
- {$ifdef mswindows}\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 mswindows}\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 mswindows}\r
+ {$ifdef winasyncdns}\r
if assigned(dwas) then begin\r
dwas.release;\r
dwas := nil;\r
onrequestdone(self,0);\r
end;\r
\r
-{$ifdef mswindows}\r
+{$ifdef winasyncdns}\r
procedure tdnsasync.winrequestdone(sender:tobject;error:word);\r
\r
begin\r