X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/19e44013088ff80c11e1d7c045331b96f4dc41f0..85edf7ed5948e0efe59301680f79ea0bac4367e8:/lsocket.pas?ds=inline 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 := '';