X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/9777e2483955343fea879378221d10f738f43b40..68ac8381cae336dda0cd718dd6fa43b677f5ef8d:/lcore.pas diff --git a/lcore.pas b/lcore.pas index 77bf4f0..727ca1c 100755 --- a/lcore.pas +++ b/lcore.pas @@ -405,6 +405,9 @@ end; procedure tlasio.internalclose(error:word); begin if (state<>wsclosed) and (state<>wsinvalidstate) then begin + // -2 is a special indication that we should just exist silently + // (used for connect failure handling when socket creation fails) + if (fdhandlein = -2) and (fdhandleout = -2) then exit; if (fdhandlein < 0) or (fdhandleout < 0) then raise exception.create('internalclose called with invalid fd handles'); eventcore.rmasterclr(fdhandlein);//fd_clr(fdhandlein,fdsrmaster); eventcore.wmasterclr(fdhandleout);//fd_clr(fdhandleout,fdswmaster); @@ -573,16 +576,16 @@ begin internalclose(0); end else begin - {$ifdef win32} - if getlasterror=WSAEWOULDBLOCK then begin - //the asynchronous nature of windows messages means we sometimes - //get here with the buffer full - //so do nothing in that case - end else - {$endif} - begin + {$ifdef win32} + if getlasterror=WSAEWOULDBLOCK then begin + //the asynchronous nature of windows messages means we sometimes + //get here with the buffer full + //so do nothing in that case + end else + {$endif} + begin internalclose({$ifdef win32}getlasterror{$else}linuxerror{$endif}); - end + end end; end;