X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/d2948bcc680fb1c36613c8535757fe0ed1faf10f..f04d9ac0ffbe96ead372b84dad0786daba7f5ed7:/lsocket.pas diff --git a/lsocket.pas b/lsocket.pas index ffd411f..898e983 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; @@ -699,6 +704,6 @@ end; result := winsock.recv(fd,buf,size,0); end; {$endif} - + end.