added lsocket.onconnecttryip handler for apps that want to use this information
authorbeware <beware@bircd.org>
Sat, 27 Feb 2010 21:16:25 +0000 (21:16 +0000)
committerbeware <beware@bircd.org>
Sat, 27 Feb 2010 21:16:25 +0000 (21:16 +0000)
git-svn-id: file:///svnroot/lcore/trunk@86 b1de8a11-f9be-4011-bde0-cc7ace90066a

lsocket.pas

index a7c6164f8864f21a5c2eb3b0e11d273b1ec54599..7f9617e55210fe5ff774c0e4ec0935ae228adae8 100755 (executable)
@@ -101,6 +101,9 @@ type
       proto:ansistring;\r
       udp,dgram:boolean;\r
       listenqueue:integer;\r
       proto:ansistring;\r
       udp,dgram:boolean;\r
       listenqueue:integer;\r
+\r
+      onconnecttryip:procedure(sender:tobject; const ip:tbinip) of object;\r
+\r
       {$ifdef secondlistener}\r
       secondlistener:tlsocket;\r
       lastsessionfromsecond:boolean;\r
       {$ifdef secondlistener}\r
       secondlistener:tlsocket;\r
       lastsessionfromsecond:boolean;\r
@@ -193,9 +196,12 @@ end;
 procedure tlsocket.realconnect;\r
 var\r
   a,b:integer;\r
 procedure tlsocket.realconnect;\r
 var\r
   a,b:integer;\r
+  iptemp:tbinip;\r
 begin\r
 begin\r
+  iptemp := biniplist_get(biniplist,currentip);\r
   //writeln('trying to connect to ',ipbintostr(biniplist_get(biniplist,currentip)),'#',port);\r
   //writeln('trying to connect to ',ipbintostr(biniplist_get(biniplist,currentip)),'#',port);\r
-  makeinaddrv(biniplist_get(biniplist,currentip),port,inaddr);\r
+  if assigned(onconnecttryip) then onconnecttryip(self,iptemp);\r
+  makeinaddrv(iptemp,port,inaddr);\r
   inc(currentip);\r
   if (currentip >= biniplist_getcount(biniplist)) then trymoreips := false;\r
 \r
   inc(currentip);\r
   if (currentip >= biniplist_getcount(biniplist)) then trymoreips := false;\r
 \r