From: beware Date: Sat, 27 Feb 2010 21:16:25 +0000 (+0000) Subject: added lsocket.onconnecttryip handler for apps that want to use this information X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/3124451e3e3e632e45928b7d28e3b2bff06e1879 added lsocket.onconnecttryip handler for apps that want to use this information git-svn-id: file:///svnroot/lcore/trunk@86 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/lsocket.pas b/lsocket.pas index a7c6164..7f9617e 100755 --- a/lsocket.pas +++ b/lsocket.pas @@ -101,6 +101,9 @@ type proto:ansistring; udp,dgram:boolean; listenqueue:integer; + + onconnecttryip:procedure(sender:tobject; const ip:tbinip) of object; + {$ifdef secondlistener} secondlistener:tlsocket; lastsessionfromsecond:boolean; @@ -193,9 +196,12 @@ end; procedure tlsocket.realconnect; var a,b:integer; + iptemp:tbinip; begin + iptemp := biniplist_get(biniplist,currentip); //writeln('trying to connect to ',ipbintostr(biniplist_get(biniplist,currentip)),'#',port); - makeinaddrv(biniplist_get(biniplist,currentip),port,inaddr); + if assigned(onconnecttryip) then onconnecttryip(self,iptemp); + makeinaddrv(iptemp,port,inaddr); inc(currentip); if (currentip >= biniplist_getcount(biniplist)) then trymoreips := false;