classes,{pgdebugout,}pgtypes,lcore,fd_utils,binipstuff,dnssync;\r
\r
{$ifdef ipv6}\r
-{$define secondlistener}\r
const\r
v4listendefault:boolean=false;\r
{$endif}\r
twsocket=tlsocket; {easy}\r
\r
\r
-{!!!function longipdns(s:string):longint;}\r
-\r
const\r
TCP_NODELAY=1;\r
IPPROTO_TCP=6;\r
end else begin\r
secondlistener.onsessionAvailable := secondaccepthandler;\r
end;\r
- secondlistener.listen;\r
+ try\r
+ secondlistener.listen;\r
+ except\r
+ secondlistener.destroy;\r
+ secondlistener := nil;\r
+ end;\r
end;\r
{$endif}\r
finally\r
{$ifdef secondlistener}\r
procedure tlsocket.internalclose(error:word);\r
begin\r
- if assigned(secondlistener) then secondlistener.destroy;\r
+ if assigned(secondlistener) then begin\r
+ secondlistener.destroy;\r
+ secondlistener := nil;\r
+ end;\r
inherited internalclose(error);\r
end;\r
\r