Article View: borland.public.cppbuilder.internet.socket
Article #4406Re: Indy TCP client conncted ?
From: Roberto Zais
Date: Wed, 23 Feb 2005 11:02
Date: Wed, 23 Feb 2005 11:02
59 lines
2574 bytes
2574 bytes
oops.. I have bad reported .
Those instructions I have written aren' t used in that sequence : I reported
them only as samples .
The sequence is
> > TCPClient->Connect();
> > if(TCPClient->Connected()) //esito == true )
Actually I have suppressed the test and it works, but I feel it is not ok...
I ' ve read that TCPClient->Connected() signals if there is
connection-and-active
What does it mean ? I remember from sockets there are two different states
named in that way ..
and Active should be the complete availability waiting state ( or live data
exchange state ? )
more: I actually use for reading :
int size = TCPClient->ReadFromStack(true,2000,true);//ReadInteger(true);
if( size > 0 )
{
char *buf = new char[size];
TCPClient->ReadBuffer(buf, size);
// use buffer as needed...
delete[] buf;
return;
}
because
int size = TCPClient->ReadInteger(true);
returns a bad 7-digit number...
Is it correct to use ReadFromStack ??
And using TCPClient->Write(ansi_temp); without any testing before ?
many thanks
Roberto
>
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> ha scritto nel messaggio
news:421b7ed0$1@newsgroups.borland.com...
>
> "Roberto Zais" <rzaiss@tiscali.it> wrote in message
> news:4219e6b2$1@newsgroups.borland.com...
>
> > TCPClient->Connect();
> > TCPClient->Disconnect();
> > if(TCPClient->Connected()) //esito == true )
>
> It should be obvious why Connected() always returns false for you - you
are
> disconnecting the connection before calling Connected(), so of course
> Connected() will be false because there really is no connection available.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<421c62ea$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4219e6b2$1@newsgroups.borland.com> <421b7ed0$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,e9928c88cb4b1587 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Roberto Zais" <rzaiss@tiscali.it> Newsgroups: borland.public.cppbuilder.internet.socket References: <4219e6b2$1@newsgroups.borland.com> <421b7ed0$1@newsgroups.borland.com> Subject: Re: Indy TCP client conncted ? Date: Wed, 23 Feb 2005 12:02:22 +0100 Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 212.171.10.97 Message-ID: <421c62ea$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1109156586 212.171.10.97 (23 Feb 2005 03:03:06 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail