X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/e27ef2c6aab3a2a8051314bd37bb3b2386775f36..3745aa61ef489e4b143b5c753a006d0613a0297f:/lsocket.pas?ds=sidebyside diff --git a/lsocket.pas b/lsocket.pas index a7c6164..bcff643 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; @@ -293,7 +299,7 @@ begin if not assigned(connecttimeout) then begin connecttimeout := tltimer.create(self); connecttimeout.ontimer := connecttimeouthandler; - connecttimeout.interval := 2500; + connecttimeout.interval := 5000; connecttimeout.enabled := false; end; realconnect;