🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #473

Re: Hang issue with

#473
From: BrianV
Date: Tue, 26 Feb 2008 05:01
51 lines
3199 bytes
Remy,
Thanks very much for your time.  I'll check out the latest indy code.


> As I told you in the other discussion thread you started, you are using an 
> old version of Indy.  The current version is 10.2.3.

I'll look at the latest and see what's different.


> If the client connects to the wrong port, there is no way for Indy to 
> detect that without reading from the socket.  In this situation, Indy is 
> expecting the server to send a line of text.  If the server does not 
> actually do that, the only thing Indy can do is wait for a timeout to 
> elapse.  It is your responsibility to make sure you connect to the correct 
> port to begin with. If you want a timeout to occur, then you will have to 
> set the ReadTimeout property before calling Connect().  Otherwise, 
> ReadLn() will use an infinite timeout by default and wait forever.


I am setting ReadTimeout, to 10 seconds (10000 ms).  To give a little deeper 
stack trace:

:006B47BC CheckIsReadable(AMSec=10000)
:006B4868 Idsockethandle::TIdSocketHandle::Readable(Self=:011D34C0, 
AMSec=10000)
:006B7625 Idiohandlerstack::TIdIOHandlerStack::Readable(Self=:01419E00, 
AMSec=10000)
:006CD5D3 
Idsslopenssl::TIdSSLIOHandlerSocketOpenSSL::ReadFromSource(Self=:01419E00, 
ARaiseExceptionIfDisconnected=true, ATimeout=10000, 
ARaiseExceptionOnTimeout=false)
:006B9267 Idiohandler::TIdIOHandler::ReadLn(Self=:01419E00, ATerminator={ 
"\n" }, ATimeout=-1, AMaxLineLength=16384)
:006B90C2 Idiohandler::TIdIOHandler::ReadLn(Self=:01419E00)
:006B9470 Idiohandler::TIdIOHandler::ReadLnWait(Self=:01419E00, 
AFailCount=2147483647)
:006AFC87 
Idtcpconnection::TIdTCPConnection::GetInternalResponse(Self=:01419F60)
:006AF834 Idtcpconnection::TIdTCPConnection::GetResponse(Self=:01419F60, 
AAllowedResponses=:0012D2B4, Result=18)
:006AFD3F Idtcpconnection::TIdTCPConnection::GetResponse(Self=:01419F60, 
AAllowedResponse=220)
:006D0790 Idsmtp::TIdSMTP::Connect(Self=:01419F60)

In other words, if I set the read timeout to 10 seconds, it waits 10 seconds 
2 billion times!  I've traced it in the debugger and this is what happens. 
I'll take a look at the latest version to see if it has the same behavior.

It does sound like it's worth the time to do the upgrade, and thanks again 
for your input. 
Technical Details
Message-ID: <47c39d1b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <47bf9844$1@newsgroups.borland.com> <47c3030d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ea302164fdd76b72
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "BrianV" <bvanmatre_remove_@yahoo.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <47bf9844$1@newsgroups.borland.com> <47c3030d$1@newsgroups.borland.com>
Subject: Re: Hang issue with 
Date: Mon, 25 Feb 2008 22:01:11 -0700
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 24.9.114.34
Message-ID: <47c39d1b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1204002075 24.9.114.34 (25 Feb 2008 21:01:15 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail