X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/19e44013088ff80c11e1d7c045331b96f4dc41f0..1c8b91ca0f6891a397357c7cf7d77af18c15937d:/lsocket.pas diff --git a/lsocket.pas b/lsocket.pas index f359a55..6a4034d 100644 --- a/lsocket.pas +++ b/lsocket.pas @@ -256,13 +256,16 @@ begin end else begin state :=wsconnecting; {$ifdef mswindows} + //beware: atleast on windows, wsaasyncselect set interest in events before connecting, or a connect error isn't seen if it happens immediately during connect + eventcore.rmasterset(fdhandlein,false); + eventcore.wmasterset(fdhandleout); //writeln(inaddr.inaddr.port); winsock.Connect(fdhandlein,winsock.psockaddr(@inADDR)^,getaddrsize); {$else} system_Connect(fdhandlein,inADDR,getaddrsize); + eventcore.rmasterset(fdhandlein,false); + eventcore.wmasterset(fdhandleout); {$endif} - eventcore.rmasterset(fdhandlein,false); - eventcore.wmasterset(fdhandleout); if trymoreips then connecttimeout.enabled := true; end; //sendq := '';