En/na Alexander Bauer ha escrit: > Hi, > > i modified TBlockSocket.Connect as follows. Works for me since about 5 > years without any problem (Windows with Delphi and Linux with FPC). > I added FConnectionTimeout as new property for TBlockSocket. > > Alex > > //------------------------------------------------------------------------------------------------------------- > procedure TBlockSocket.Connect(IP, Port: string); > var > Sin: TVarSin; > begin > SetSin(Sin, IP, Port); > if FLastError = 0 then > begin > if FSocket = INVALID_SOCKET then > InternalCreateSocket(Sin); > if FConnectionTimeout > 0 then > begin > // connect in non-blocking mode > NonBlockMode := true; > SockCheck(synsock.Connect(FSocket, Sin)); > if (FLastError = WSAEINPROGRESS) OR (FLastError = WSAEWOULDBLOCK) then > if not CanWrite(FConnectionTimeout) then > begin > FLastError := WSAETIMEDOUT; > FLastErrorDesc := GetErrorDesc(FLastError); > end; > NonBlockMode := false; > end else begin > // connect in blocking mode > SockCheck(synsock.Connect(FSocket, Sin)); > if FLastError = 0 then > GetSins; > end; > FBuffer := ''; > FLastCR := False; > FLastLF := False; > end; > ExceptCheck; > DoStatus(HR_Connect, IP + ':' + Port); > end;
Sorry to revive this old thread, but this code isn't in trunk yet. Is there a reason or was it simply forgotten? Bye -- Luca ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ synalist-public mailing list synalist-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synalist-public