🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: IdTCPClient Connected question

#1476
From: Dennis Jones
Date: Fri, 26 Jan 2007 04:49
62 lines
3123 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:45b97154$1@newsgroups.borland.com...
>

> There is no way to determine the current state while the socket is
> still in a volatile condition

For someone who is supposed to know Indy so well, you seem to have missed 
the obvious solution to my query - the OnStaus event provides exactly what I 
want.


>> When the connection is up, you want to indicate a "Connected"
> status;
>> when it is not, you want to indicate a "Not connected" status.
>
> Which is exactly what Connected() does - EXCEPT when Connect() is
> still running because the state is not known at the moment Connected()
> is called.

If the state is not known, then why does 'Connected' change from false to 
true while it is trying to connect?


>> It should be obvious that it would be ridiculous to indicate
> "Connected"
>> during those few moments when it is trying to establish a connection
>
> If you read the documentation for Connected(), it says exactly under
> which conditions Connected() returns True.  Those conditions are met
> while the socket is in the process of establishing a connection.  If
> you don't like it, then don't call Connected() while Connect() is
> running.

Quote from the Indy online help for the Connected property:

"Connected is a Boolean function used to indicate when the connection to the 
peer is open and active."

I fail to see anything that even remotely suggests that it returns true when 
it is in the process of establishing a connection.


> That thread has no business querying the connection until after
> Connect() has been called and exited one way or the other.  During
> that time, the connection state is unstable, so of course the result
> of Connected() will be questionable during that time.

So you've said.  I disagree.


>> Who is to say that I am calling them out of order?
>
> I am.  Knowing Indy inside and out like I do,

Then why are you so bent on belittling me instead of pointing me in the 
direction of OnStatus?

Get off your high-horse, Remy.  A little humility would serve you well.

- Dennis 
Technical Details
Message-ID: <45b9882b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <45b9274f@newsgroups.borland.com> <45b938e2$1@newsgroups.borland.com> <45b95649$1@newsgroups.borland.com> <45b97154$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,e8cbc2087e955870
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Dennis Jones" <nospam@nospam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <45b9274f@newsgroups.borland.com> <45b938e2$1@newsgroups.borland.com> <45b95649$1@newsgroups.borland.com> <45b97154$1@newsgroups.borland.com>
Subject: Re: IdTCPClient Connected question
Date: Thu, 25 Jan 2007 20:49:31 -0800
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 71.245.109.58
Message-ID: <45b9882b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1169786923 71.245.109.58 (25 Jan 2007 20:48:43 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail