Article View: borland.public.cppbuilder.internet.socket
Article #471Re: Hang issue with
From: Remy Lebeau (TeamB)
Date: Mon, 25 Feb 2008 18:04
Date: Mon, 25 Feb 2008 18:04
40 lines
2659 bytes
2659 bytes
"BrianV" <bvanmatre_remove_@yahoo.com> wrote in message news:47bf9844$1@newsgroups.borland.com... > I'm having lots of trouble getting Indy SMTP to work reliably for me. Then you are likely using it wrong to begin with. TIdSMTP is quite reliable when used properly. > I am using 10.1.5, the version that ships with C++ Builder 2007. 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. > When calling Connect() on a IdSMTP component, the flow > goes through Indy code like this: <snip> The SMTP protocol dictates that the server is required to send a greeting to the client upon a successful connection to the server. That is what GetResponse() is reading inside of Connect(). > The neat thing about this last method, is that no matter what > you set timeouts to, this last method is called without a value > for AFailCount, and so it loops through MaxInt times. So if a > user ever enters an incorrect port for their SMTP connection, > there doesn't seem to be any straightforward way to avoid an > interminable timeout where the app just hangs. 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. Gambit
Technical Details
Message-ID:
<47c3030d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47bf9844$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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <47bf9844$1@newsgroups.borland.com> Subject: Re: Hang issue with Date: Mon, 25 Feb 2008 10:04:21 -0800 Lines: 42 Organization: Lebeau Software 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: 207.178.157.90 Message-ID: <47c3030d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1203962637 207.178.157.90 (25 Feb 2008 10:03:57 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail