X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/d2948bcc680fb1c36613c8535757fe0ed1faf10f..4be21e4a341fbd4c8ecc14675fe6db9de7d18fec:/lsocket.pas?ds=sidebyside diff --git a/lsocket.pas b/lsocket.pas index ffd411f..7438c26 100755 --- a/lsocket.pas +++ b/lsocket.pas @@ -56,7 +56,6 @@ interface classes,{pgdebugout,}pgtypes,lcore,fd_utils,binipstuff,dnssync; {$ifdef ipv6} -{$define secondlistener} const v4listendefault:boolean=false; {$endif} @@ -143,8 +142,6 @@ type twsocket=tlsocket; {easy} -{!!!function longipdns(s:string):longint;} - const TCP_NODELAY=1; IPPROTO_TCP=6; @@ -385,7 +382,12 @@ begin end else begin secondlistener.onsessionAvailable := secondaccepthandler; end; - secondlistener.listen; + try + secondlistener.listen; + except + secondlistener.destroy; + secondlistener := nil; + end; end; {$endif} finally @@ -408,7 +410,10 @@ end; {$ifdef secondlistener} procedure tlsocket.internalclose(error:word); begin - if assigned(secondlistener) then secondlistener.destroy; + if assigned(secondlistener) then begin + secondlistener.destroy; + secondlistener := nil; + end; inherited internalclose(error); end;